作者 刘锟

update

... ... @@ -54,7 +54,7 @@ class Temp extends Command
*/
public function specialImport()
{
$file_url = 'https://ecdn6.globalso.com/upload/p/3531/file/2025-07/www-cninfo-com-cn_news_v1-1.csv';
$file_url = 'https://ecdn6.globalso.com/upload/p/3531/file/2025-07/www-cninfo-com-cn_news_v1-2.csv';
$domain = 'static.cninfo.com.cn';
$project_id = 3531;
$is_gbk = 0;
... ... @@ -138,11 +138,19 @@ class Temp extends Command
protected function importModule($project_id, $domain, $data)
{
$module_id = 4;
$category_id = 3;
$model = new CustomModuleContent();
$module = $model->read(['module_id' => $module_id, 'name' => $data[0]]);
if (!$module) {
$category_id = '';
if ($data[2] ?? '') {
if ($data['2'] == '最新公告') {
$category_id = ',3,4,';
} elseif ($data['2'] == '定期报告') {
$category_id = ',3,5,';
}
}
$content = '';
if ($data[4] ?? '') {
//处理内容中的pdf文件
... ... @@ -199,7 +207,7 @@ class Temp extends Command
$id = $model->addReturnId(
[
'name' => $data[0],
'category_id' => ',' . $category_id . ',',
'category_id' => $category_id,
'module_id' => $module_id,
'content' => $content,
'seo_title' => $seo_title,
... ... @@ -218,9 +226,20 @@ class Temp extends Command
$model->edit(['route' => $route], ['id' => $id]);
return true;
}
} else {
$category_id = '';
if ($data[2] ?? '') {
if ($data['2'] == '最新公告') {
$category_id = ',3,4,';
} elseif ($data['2'] == '定期报告') {
$category_id = ',3,5,';
}
}
return false;
$model->edit(['category_id' => $category_id], ['id' => $module['id']]);
return false;
}
}
//特殊字符转换
... ...