1
This commit is contained in:
@@ -507,17 +507,18 @@ class Base extends Controller
|
||||
if (in_array(strtolower($extension), ['jpg', 'jpeg', 'png'])) {
|
||||
// 处理图片文件
|
||||
file_put_contents($base_url . $newFileName, $fileContent);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['url'] = $article_id . "/" . $newFileName;
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert);
|
||||
$insert11['article_id'] = $article_id;
|
||||
$insert11['url'] = $article_id . "/" . $newFileName;
|
||||
$insert11['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert11);
|
||||
} elseif (in_array(strtolower($extension), ['tiff', 'tif'])) {
|
||||
// 处理 TIFF 和 EMF 文件并转换为 JPG
|
||||
file_put_contents($base_url . $newFileName, $fileContent);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['url'] = $this->crossTifToPng($article_id . "/" . $newFileName);
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert);
|
||||
$insert2['article_id'] = $article_id;
|
||||
$crre = $this->crossTifToPng($article_id . "/" . $newFileName);
|
||||
$insert2['url'] = $crre==null?"":$crre;
|
||||
$insert2['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert2);
|
||||
} elseif ($extension == "docx") {
|
||||
$word_dir = ROOT_PATH . "public/articleCache/" . $article_id;
|
||||
if (!is_dir($word_dir)) {
|
||||
@@ -535,10 +536,10 @@ class Base extends Controller
|
||||
$file_runs = $res['data']['list'];
|
||||
foreach ($file_runs as $val) {
|
||||
$ex = pathinfo($val,PATHINFO_EXTENSION);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['url'] = ($ex=="tif"||$ex=="tiff")?crossTifToPng($val):$val;
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert);
|
||||
$insert3['article_id'] = $article_id;
|
||||
$insert3['url'] = ($ex=="tif"||$ex=="tiff")?crossTifToPng($val):$val;
|
||||
$insert3['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user