作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server

... ... @@ -77,6 +77,7 @@ class GeoQuestionRes extends Command
$geoLogModel = new GeoQuestionLog();
foreach ($taskInfo['question'] as $question) {
$en_question = Translate::tran($question, 'zh') ?? '';
$this->output('项目ID:' . $taskInfo['project_id'] . ', 问题 开始:' . $question);
foreach ($platformsArr as $platform) {
$data = $hit_data = [];
$error_num = 0;
... ... @@ -84,10 +85,10 @@ class GeoQuestionRes extends Command
GET_RESULT:
$error_num++;
try {
$this->output('执行时间:'.date('Y-m-d H:i:s').'->执行次数:'.$error_num.',执行平台:'.$platform.'执行的项目id:'.$taskInfo['project_id'].PHP_EOL);
if ($error_num >= 3) {
continue;
}
$this->output('执行平台:' . $platform . '执行次数:' . $error_num);
switch ($platform){
case 'google_ai_overview':
// overview 数据结构不确定, 需要单独处理数据
... ...
... ... @@ -43,7 +43,7 @@ class Temp extends Command
public function handle()
{
$this->specialImport();
}
/**
... ... @@ -54,8 +54,8 @@ class Temp extends Command
*/
public function specialImport()
{
$file_url = 'https://ecdn6.globalso.com/upload/p/3531/file/2025-06/news.csv';
$domain = 'www.hybio.com.cn';
$file_url = 'https://ecdn6.globalso.com/upload/p/3531/file/2025-07/www-cninfo-com-cn_news_v1-1.csv';
$domain = 'static.cninfo.com.cn';
$project_id = 3531;
$is_gbk = 0;
$file_code_type = $this->get_code_type($file_url);
... ... @@ -137,47 +137,58 @@ class Temp extends Command
protected function importModule($project_id, $domain, $data)
{
$module_id = 4;
$category_id = 3;
$model = new CustomModuleContent();
$module = $model->read(['name' => $data[0]]);
$module = $model->read(['module_id' => $module_id, 'name' => $data[0]]);
if (!$module) {
$content = '';
if ($data[4] ?? '') {
//处理内容中的图片
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result);
//处理内容中的pdf文件
preg_match_all('/<a\s+[^>]*?href\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result);
if ($result[2] ?? []) {
foreach ($result[2] as $img) {
$new_img = check_remote_url_down($img, $project_id, $domain, 1);
$new_img && $data[4] = str_replace($img, $new_img, $data[4]);
foreach ($result[2] as $pdf) {
$new_img = check_remote_url_down($pdf, $project_id, $domain, 1);
$new_img && $data[4] = str_replace($pdf, $new_img, $data[4]);
}
}
//处理内容中的图片
// preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result);
// if ($result[2] ?? []) {
// foreach ($result[2] as $img) {
// $new_img = check_remote_url_down($img, $project_id, $domain, 1);
// $new_img && $data[4] = str_replace($img, $new_img, $data[4]);
// }
// }
//处理内容中的视频
preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result_video);
if ($result_video[2] ?? []) {
foreach ($result_video[2] as $video) {
$new_video = check_remote_url_down($video, $project_id, $domain, 1);
$new_video && $data[4] = str_replace($video, $new_video, $data[4]);
}
}
// preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[4], $result_video);
// if ($result_video[2] ?? []) {
// foreach ($result_video[2] as $video) {
// $new_video = check_remote_url_down($video, $project_id, $domain, 1);
// $new_video && $data[4] = str_replace($video, $new_video, $data[4]);
// }
// }
$content = $data[4];
}
$seo_title = '';
if ($data[6] ?? '') {
$seo_title = substr(strip_tags($data[6]), 0, 70);
}
$seo_title = '巨潮资讯网';
// if ($data[6] ?? '') {
// $seo_title = substr(strip_tags($data[6]), 0, 70);
// }
$seo_keywords = '';
if ($data[7] ?? '') {
$seo_keywords = substr(strip_tags(str_replace('^v6sp$', ',', $data[7])), 0, 255);
}
$seo_keywords = '巨潮资讯网,巨潮网,巨潮资讯,上市公司公告,巨潮,信息披露,法定披露,披露,创业板,基金,债券,财务数据,网络投票,互动易';
// if ($data[7] ?? '') {
// $seo_keywords = substr(strip_tags(str_replace('^v6sp$', ',', $data[7])), 0, 255);
// }
$seo_description = '';
if ($data[8] ?? '') {
$seo_description = substr(strip_tags($data[8]), 0, 200);
}
$seo_description = '巨潮资讯网是中国证监会指定的上市公司信息披露网站,平台提供上市公司公告、公司资讯、公司互动、股东大会网络投票等内容功能,一站式服务资本市场投资者。';
// if ($data[8] ?? '') {
// $seo_description = substr(strip_tags($data[8]), 0, 200);
// }
$release_at = date('Y-m-d H:i:s');
if ($data[9] ?? '') {
... ... @@ -188,8 +199,8 @@ class Temp extends Command
$id = $model->addReturnId(
[
'name' => $data[0],
'category_id' => ',1,',
'module_id' => 2,
'category_id' => ',' . $category_id . ',',
'module_id' => $module_id,
'content' => $content,
'seo_title' => $seo_title,
'seo_keywords' => $seo_keywords,
... ...
... ... @@ -174,8 +174,8 @@ class NoticeController extends BaseController
'target_domain' => $target_domain
]);
}else{
if($task_redirect_info['status'] == DomainRedirectTask::STATUS_FAL){
$redirect_model->edit(['status'=>DomainRedirectTask::STATUS_UN,'error_msg'=>null],['id'=>$task_redirect_info['id']]);
if($task_redirect_info['status'] > DomainRedirectTask::STATUS_ING){
$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']]);
}
}
... ...
... ... @@ -15,6 +15,7 @@ class Notify extends Base
const STATUS_FINISH_PAGE = 2;
const STATUS_FINISH_SITEMAP = 3;
const STATUS_ING_SITEMAP = 4;
const STATUS_MAX_PAGE = 8;
const STATUS_ERROR = 9;
/**
... ... @@ -32,7 +33,8 @@ class Notify extends Base
* 3:指定路由,按url生成
* 4:生成聚合页生成
* 5:生成漏翻页面
* 6:生成视频聚合页
* 6:生成视频聚合
* 7:生成AI博客页面
*/
const ROUTE_ALL = 1;
const ROUTE_NEED = 2;
... ... @@ -59,6 +61,7 @@ class Notify extends Base
self::TYPE_MASTER => '主站',
self::TYPE_MINOR => '小语种',
self::TYPE_AMP => 'AMP',
self::TYPE_ALL_SITEMAP => 'sitemap',
];
}
... ... @@ -70,7 +73,7 @@ class Notify extends Base
{
return [
self::ROUTE_ALL => '主站页面',
self::ROUTE_NEED => '更新页面',
self::ROUTE_NEED => '按需更新',
self::ROUTE_URL => '指定路由',
self::ROUTE_PRODUCT_KEYWORD => '聚合页面',
self::ROUTE_NOT_TRANSLATE => '漏翻检查',
... ... @@ -90,8 +93,9 @@ class Notify extends Base
self::STATUS_FINISH_ROUTE => '页面生成中',
self::STATUS_FINISH_PAGE => 'sitemap排队中',
self::STATUS_ING_SITEMAP => 'sitemap生成中',
self::STATUS_FINISH_SITEMAP => '完成',
self::STATUS_ERROR => '失败',
self::STATUS_FINISH_SITEMAP => '任务完成',
self::STATUS_MAX_PAGE => '数量超限停止',
self::STATUS_ERROR => '任务失败',
];
}
}
... ...
... ... @@ -435,6 +435,10 @@ class Project extends Base
}
$project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
if(empty($project_id)){
//项目多语言自定义跳转连接
$project_id = CountryCustom::where('is_create', 1)->where('custom_domain', $domain)->value('project_id');
}
if (empty($project_id)) {
//是否小语种域名或amp站域名
$domainPrefix = explode(".",$domain);
... ...