作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

... ... @@ -45,7 +45,12 @@ class RankData extends BaseCommands
{
Log::channel('rank_data')->info('开始-排名数据');
//同步api_no
$this->SyncApiNo();
try {
$this->SyncApiNo();
}catch (\Exception $e){
Log::channel('rank_data')->error('同步api_no失败:' . $e->getMessage());
}
//所有项目 今日是否达标 重置
//有失败会重跑任务,导致达标又被重置 加缓存一天只重置一次
... ...
... ... @@ -167,7 +167,7 @@ class UpdateSeoTdk extends Command
$ai_commands = AiCommand::where('is_batch', 1)->select('key', 'scene', 'ai')->get()->toArray();
$ai_commands = Arr::setValueToKey($ai_commands, 'key');
foreach ($this->maps as $table => $map) {
$update[$table] = ['total_page'=>0, 'title'=>0, 'keyword'=>0, 'des'=>0];
$update[$table] = ['total_page'=>0, 'title'=>0, 'keyword'=>0, 'des'=>0,'keyword_title'=>0,'keyword_content'=>0];
echo date('Y-m-d H:i:s') . '更新--' . $table . ': 项目id' . $project_id . PHP_EOL;
$list = DB::connection('custom_mysql')->table($table)->select('id')->get();
if (!empty($list)) {
... ... @@ -227,6 +227,12 @@ class UpdateSeoTdk extends Command
if($field == 'seo_description' || $field == 'description' || $field == 'seo_des'){
$update[$table]['des']++;
}
if($field == 'keyword_title'){
$update[$table]['keyword_title']++;
}
if($field == 'keyword_content'){
$update[$table]['keyword_content']++;
}
$data[$field] = $this->ai_send($prompt);
}
} else {
... ... @@ -261,6 +267,12 @@ class UpdateSeoTdk extends Command
if($field == 'seo_description' || $field == 'description' || $field == 'seo_des'){
$update[$table]['des']++;
}
if($field == 'keyword_title'){
$update[$table]['keyword_title']++;
}
if($field == 'keyword_content'){
$update[$table]['keyword_content']++;
}
}
}
}
... ...
... ... @@ -312,7 +312,7 @@ class WebTraffic extends Command
$other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray();
$data = [];
foreach ($list as $project) {
$lang = WebLanguage::getLangById($this->project['main_lang_id']??1)['short'];
$lang = WebLanguage::getLangById($project['main_lang_id']??1)['short'];
if(empty($project->domainInfo['domain'])){
continue;
}
... ...
... ... @@ -802,11 +802,16 @@ class ProjectController extends BaseController
];
foreach ($data as $k => $v){
if(isset($item[$k])){
$item[$k] = Arr::s2a($item[$k]);
$item[$k] = $v.'总条数:'.$item[$k]['total_page'].
', title更新数:'.$item[$k]['title'].
',keyword更新数据:'.$item[$k]['keyword'].
',des更新数据:'.$item[$k]['des'];
$data = Arr::s2a($item[$k]);
//{"des": 3500, "title": 0, "keyword": 3501, "total_page": 8458, "keyword_title": 3500, "keyword_content": 3500}
$item[$k] = $v.'总条数:'.$data['total_page'].
', title更新数:'.$data['title'].
',keyword更新数:'.$data['keyword'].
',des更新数:'.$data['des'];
if($k == 'gl_product_keyword'){
$item[$k] .= ',keyword_title更新数:'.($data['keyword_title']??0);
$item[$k] .= ',keyword_content更新数:'.($data['keyword_content']??0);
}
}
}
... ...
... ... @@ -604,6 +604,9 @@ class ProjectLogic extends BaseLogic
if($rs === false){
$this->fail('error');
}
//更新当前项目所有账号状态
$userModel = new UserModel();
$userModel->edit(['status'=>1],['project_id'=>$this->param['id']]);
return $this->success();
}
... ...
... ... @@ -55,7 +55,7 @@ class UserLoginLogic
$projectArr[] = $v['project_id'];
}
$projectModel = new Project();
$project_list = $projectModel->list(['id'=>['in',$projectArr]],'id',['id','title']);
$project_list = $projectModel->list(['id'=>['in',$projectArr],['delete_status'=>0]],'id',['id','title']);
//登录选择项目的有效时间
Cache::add('login-project-'.$this->param['mobile'],1,300);
return $this->success($project_list);
... ...