Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server
正在显示
5 个修改的文件
包含
57 行增加
和
37 行删除
| @@ -77,6 +77,7 @@ class GeoQuestionRes extends Command | @@ -77,6 +77,7 @@ class GeoQuestionRes extends Command | ||
| 77 | $geoLogModel = new GeoQuestionLog(); | 77 | $geoLogModel = new GeoQuestionLog(); |
| 78 | foreach ($taskInfo['question'] as $question) { | 78 | foreach ($taskInfo['question'] as $question) { |
| 79 | $en_question = Translate::tran($question, 'zh') ?? ''; | 79 | $en_question = Translate::tran($question, 'zh') ?? ''; |
| 80 | + $this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question); | ||
| 80 | foreach ($platformsArr as $platform) { | 81 | foreach ($platformsArr as $platform) { |
| 81 | $data = $hit_data = []; | 82 | $data = $hit_data = []; |
| 82 | $error_num = 0; | 83 | $error_num = 0; |
| @@ -84,10 +85,10 @@ class GeoQuestionRes extends Command | @@ -84,10 +85,10 @@ class GeoQuestionRes extends Command | ||
| 84 | GET_RESULT: | 85 | GET_RESULT: |
| 85 | $error_num++; | 86 | $error_num++; |
| 86 | try { | 87 | try { |
| 87 | - $this->output('执行时间:'.date('Y-m-d H:i:s').'->执行次数:'.$error_num.',执行平台:'.$platform.'执行的项目id:'.$taskInfo['project_id'].PHP_EOL); | ||
| 88 | if ($error_num >= 3) { | 88 | if ($error_num >= 3) { |
| 89 | continue; | 89 | continue; |
| 90 | } | 90 | } |
| 91 | + $this->output('执行平台:' . $platform . '执行次数:' . $error_num); | ||
| 91 | switch ($platform){ | 92 | switch ($platform){ |
| 92 | case 'google_ai_overview': | 93 | case 'google_ai_overview': |
| 93 | // overview 数据结构不确定, 需要单独处理数据 | 94 | // overview 数据结构不确定, 需要单独处理数据 |
| @@ -43,7 +43,7 @@ class Temp extends Command | @@ -43,7 +43,7 @@ class Temp extends Command | ||
| 43 | 43 | ||
| 44 | public function handle() | 44 | public function handle() |
| 45 | { | 45 | { |
| 46 | - | 46 | + $this->specialImport(); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| @@ -54,8 +54,8 @@ class Temp extends Command | @@ -54,8 +54,8 @@ class Temp extends Command | ||
| 54 | */ | 54 | */ |
| 55 | public function specialImport() | 55 | public function specialImport() |
| 56 | { | 56 | { |
| 57 | - $file_url = 'https://ecdn6.globalso.com/upload/p/3531/file/2025-06/news.csv'; | ||
| 58 | - $domain = 'www.hybio.com.cn'; | 57 | + $file_url = 'https://ecdn6.globalso.com/upload/p/3531/file/2025-07/www-cninfo-com-cn_news_v1-1.csv'; |
| 58 | + $domain = 'static.cninfo.com.cn'; | ||
| 59 | $project_id = 3531; | 59 | $project_id = 3531; |
| 60 | $is_gbk = 0; | 60 | $is_gbk = 0; |
| 61 | $file_code_type = $this->get_code_type($file_url); | 61 | $file_code_type = $this->get_code_type($file_url); |
| @@ -137,47 +137,58 @@ class Temp extends Command | @@ -137,47 +137,58 @@ class Temp extends Command | ||
| 137 | 137 | ||
| 138 | protected function importModule($project_id, $domain, $data) | 138 | protected function importModule($project_id, $domain, $data) |
| 139 | { | 139 | { |
| 140 | + $module_id = 4; | ||
| 141 | + $category_id = 3; | ||
| 140 | $model = new CustomModuleContent(); | 142 | $model = new CustomModuleContent(); |
| 141 | - $module = $model->read(['name' => $data[0]]); | 143 | + $module = $model->read(['module_id' => $module_id, 'name' => $data[0]]); |
| 142 | if (!$module) { | 144 | if (!$module) { |
| 143 | 145 | ||
| 144 | $content = ''; | 146 | $content = ''; |
| 145 | if ($data[4] ?? '') { | 147 | if ($data[4] ?? '') { |
| 146 | - //处理内容中的图片 | ||
| 147 | - preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result); | 148 | + //处理内容中的pdf文件 |
| 149 | + preg_match_all('/<a\s+[^>]*?href\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result); | ||
| 148 | if ($result[2] ?? []) { | 150 | if ($result[2] ?? []) { |
| 149 | - foreach ($result[2] as $img) { | ||
| 150 | - $new_img = check_remote_url_down($img, $project_id, $domain, 1); | ||
| 151 | - $new_img && $data[4] = str_replace($img, $new_img, $data[4]); | 151 | + foreach ($result[2] as $pdf) { |
| 152 | + $new_img = check_remote_url_down($pdf, $project_id, $domain, 1); | ||
| 153 | + $new_img && $data[4] = str_replace($pdf, $new_img, $data[4]); | ||
| 152 | } | 154 | } |
| 153 | } | 155 | } |
| 154 | 156 | ||
| 157 | + //处理内容中的图片 | ||
| 158 | +// preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result); | ||
| 159 | +// if ($result[2] ?? []) { | ||
| 160 | +// foreach ($result[2] as $img) { | ||
| 161 | +// $new_img = check_remote_url_down($img, $project_id, $domain, 1); | ||
| 162 | +// $new_img && $data[4] = str_replace($img, $new_img, $data[4]); | ||
| 163 | +// } | ||
| 164 | +// } | ||
| 165 | + | ||
| 155 | //处理内容中的视频 | 166 | //处理内容中的视频 |
| 156 | - preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result_video); | ||
| 157 | - if ($result_video[2] ?? []) { | ||
| 158 | - foreach ($result_video[2] as $video) { | ||
| 159 | - $new_video = check_remote_url_down($video, $project_id, $domain, 1); | ||
| 160 | - $new_video && $data[4] = str_replace($video, $new_video, $data[4]); | ||
| 161 | - } | ||
| 162 | - } | 167 | +// preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result_video); |
| 168 | +// if ($result_video[2] ?? []) { | ||
| 169 | +// foreach ($result_video[2] as $video) { | ||
| 170 | +// $new_video = check_remote_url_down($video, $project_id, $domain, 1); | ||
| 171 | +// $new_video && $data[4] = str_replace($video, $new_video, $data[4]); | ||
| 172 | +// } | ||
| 173 | +// } | ||
| 163 | 174 | ||
| 164 | $content = $data[4]; | 175 | $content = $data[4]; |
| 165 | } | 176 | } |
| 166 | 177 | ||
| 167 | - $seo_title = ''; | ||
| 168 | - if ($data[6] ?? '') { | ||
| 169 | - $seo_title = substr(strip_tags($data[6]), 0, 70); | ||
| 170 | - } | 178 | + $seo_title = '巨潮资讯网'; |
| 179 | +// if ($data[6] ?? '') { | ||
| 180 | +// $seo_title = substr(strip_tags($data[6]), 0, 70); | ||
| 181 | +// } | ||
| 171 | 182 | ||
| 172 | - $seo_keywords = ''; | ||
| 173 | - if ($data[7] ?? '') { | ||
| 174 | - $seo_keywords = substr(strip_tags(str_replace('^v6sp$', ',', $data[7])), 0, 255); | ||
| 175 | - } | 183 | + $seo_keywords = '巨潮资讯网,巨潮网,巨潮资讯,上市公司公告,巨潮,信息披露,法定披露,披露,创业板,基金,债券,财务数据,网络投票,互动易'; |
| 184 | +// if ($data[7] ?? '') { | ||
| 185 | +// $seo_keywords = substr(strip_tags(str_replace('^v6sp$', ',', $data[7])), 0, 255); | ||
| 186 | +// } | ||
| 176 | 187 | ||
| 177 | - $seo_description = ''; | ||
| 178 | - if ($data[8] ?? '') { | ||
| 179 | - $seo_description = substr(strip_tags($data[8]), 0, 200); | ||
| 180 | - } | 188 | + $seo_description = '巨潮资讯网是中国证监会指定的上市公司信息披露网站,平台提供上市公司公告、公司资讯、公司互动、股东大会网络投票等内容功能,一站式服务资本市场投资者。'; |
| 189 | +// if ($data[8] ?? '') { | ||
| 190 | +// $seo_description = substr(strip_tags($data[8]), 0, 200); | ||
| 191 | +// } | ||
| 181 | 192 | ||
| 182 | $release_at = date('Y-m-d H:i:s'); | 193 | $release_at = date('Y-m-d H:i:s'); |
| 183 | if ($data[9] ?? '') { | 194 | if ($data[9] ?? '') { |
| @@ -188,8 +199,8 @@ class Temp extends Command | @@ -188,8 +199,8 @@ class Temp extends Command | ||
| 188 | $id = $model->addReturnId( | 199 | $id = $model->addReturnId( |
| 189 | [ | 200 | [ |
| 190 | 'name' => $data[0], | 201 | 'name' => $data[0], |
| 191 | - 'category_id' => ',1,', | ||
| 192 | - 'module_id' => 2, | 202 | + 'category_id' => ',' . $category_id . ',', |
| 203 | + 'module_id' => $module_id, | ||
| 193 | 'content' => $content, | 204 | 'content' => $content, |
| 194 | 'seo_title' => $seo_title, | 205 | 'seo_title' => $seo_title, |
| 195 | 'seo_keywords' => $seo_keywords, | 206 | 'seo_keywords' => $seo_keywords, |
| @@ -174,8 +174,8 @@ class NoticeController extends BaseController | @@ -174,8 +174,8 @@ class NoticeController extends BaseController | ||
| 174 | 'target_domain' => $target_domain | 174 | 'target_domain' => $target_domain |
| 175 | ]); | 175 | ]); |
| 176 | }else{ | 176 | }else{ |
| 177 | - if($task_redirect_info['status'] == DomainRedirectTask::STATUS_FAL){ | ||
| 178 | - $redirect_model->edit(['status'=>DomainRedirectTask::STATUS_UN,'error_msg'=>null],['id'=>$task_redirect_info['id']]); | 177 | + if($task_redirect_info['status'] > DomainRedirectTask::STATUS_ING){ |
| 178 | + $redirect_model->edit(['other_domain' => json_encode($other_domain), 'target_domain' => $target_domain, 'status'=>DomainRedirectTask::STATUS_UN, 'error_msg'=>null],['id'=>$task_redirect_info['id']]); | ||
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 |
| @@ -15,6 +15,7 @@ class Notify extends Base | @@ -15,6 +15,7 @@ class Notify extends Base | ||
| 15 | const STATUS_FINISH_PAGE = 2; | 15 | const STATUS_FINISH_PAGE = 2; |
| 16 | const STATUS_FINISH_SITEMAP = 3; | 16 | const STATUS_FINISH_SITEMAP = 3; |
| 17 | const STATUS_ING_SITEMAP = 4; | 17 | const STATUS_ING_SITEMAP = 4; |
| 18 | + const STATUS_MAX_PAGE = 8; | ||
| 18 | const STATUS_ERROR = 9; | 19 | const STATUS_ERROR = 9; |
| 19 | 20 | ||
| 20 | /** | 21 | /** |
| @@ -32,7 +33,8 @@ class Notify extends Base | @@ -32,7 +33,8 @@ class Notify extends Base | ||
| 32 | * 3:指定路由,按url生成 | 33 | * 3:指定路由,按url生成 |
| 33 | * 4:生成聚合页生成 | 34 | * 4:生成聚合页生成 |
| 34 | * 5:生成漏翻页面 | 35 | * 5:生成漏翻页面 |
| 35 | - * 6:生成视频聚合页 | 36 | + * 6:生成视频聚合 |
| 37 | + * 7:生成AI博客页面 | ||
| 36 | */ | 38 | */ |
| 37 | const ROUTE_ALL = 1; | 39 | const ROUTE_ALL = 1; |
| 38 | const ROUTE_NEED = 2; | 40 | const ROUTE_NEED = 2; |
| @@ -59,6 +61,7 @@ class Notify extends Base | @@ -59,6 +61,7 @@ class Notify extends Base | ||
| 59 | self::TYPE_MASTER => '主站', | 61 | self::TYPE_MASTER => '主站', |
| 60 | self::TYPE_MINOR => '小语种', | 62 | self::TYPE_MINOR => '小语种', |
| 61 | self::TYPE_AMP => 'AMP', | 63 | self::TYPE_AMP => 'AMP', |
| 64 | + self::TYPE_ALL_SITEMAP => 'sitemap', | ||
| 62 | ]; | 65 | ]; |
| 63 | } | 66 | } |
| 64 | 67 | ||
| @@ -70,7 +73,7 @@ class Notify extends Base | @@ -70,7 +73,7 @@ class Notify extends Base | ||
| 70 | { | 73 | { |
| 71 | return [ | 74 | return [ |
| 72 | self::ROUTE_ALL => '主站页面', | 75 | self::ROUTE_ALL => '主站页面', |
| 73 | - self::ROUTE_NEED => '更新页面', | 76 | + self::ROUTE_NEED => '按需更新', |
| 74 | self::ROUTE_URL => '指定路由', | 77 | self::ROUTE_URL => '指定路由', |
| 75 | self::ROUTE_PRODUCT_KEYWORD => '聚合页面', | 78 | self::ROUTE_PRODUCT_KEYWORD => '聚合页面', |
| 76 | self::ROUTE_NOT_TRANSLATE => '漏翻检查', | 79 | self::ROUTE_NOT_TRANSLATE => '漏翻检查', |
| @@ -90,8 +93,9 @@ class Notify extends Base | @@ -90,8 +93,9 @@ class Notify extends Base | ||
| 90 | self::STATUS_FINISH_ROUTE => '页面生成中', | 93 | self::STATUS_FINISH_ROUTE => '页面生成中', |
| 91 | self::STATUS_FINISH_PAGE => 'sitemap排队中', | 94 | self::STATUS_FINISH_PAGE => 'sitemap排队中', |
| 92 | self::STATUS_ING_SITEMAP => 'sitemap生成中', | 95 | self::STATUS_ING_SITEMAP => 'sitemap生成中', |
| 93 | - self::STATUS_FINISH_SITEMAP => '完成', | ||
| 94 | - self::STATUS_ERROR => '失败', | 96 | + self::STATUS_FINISH_SITEMAP => '任务完成', |
| 97 | + self::STATUS_MAX_PAGE => '数量超限停止', | ||
| 98 | + self::STATUS_ERROR => '任务失败', | ||
| 95 | ]; | 99 | ]; |
| 96 | } | 100 | } |
| 97 | } | 101 | } |
| @@ -435,6 +435,10 @@ class Project extends Base | @@ -435,6 +435,10 @@ class Project extends Base | ||
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | $project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id'); | 437 | $project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id'); |
| 438 | + if(empty($project_id)){ | ||
| 439 | + //项目多语言自定义跳转连接 | ||
| 440 | + $project_id = CountryCustom::where('is_create', 1)->where('custom_domain', $domain)->value('project_id'); | ||
| 441 | + } | ||
| 438 | if (empty($project_id)) { | 442 | if (empty($project_id)) { |
| 439 | //是否小语种域名或amp站域名 | 443 | //是否小语种域名或amp站域名 |
| 440 | $domainPrefix = explode(".",$domain); | 444 | $domainPrefix = explode(".",$domain); |
-
请 注册 或 登录 后发表评论