|
...
|
...
|
@@ -427,9 +427,8 @@ class RankDataLogic extends BaseLogic |
|
|
|
|
|
|
|
$first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0;
|
|
|
|
|
|
|
|
if(!$lang){
|
|
|
|
foreach ($data as &$ranks){
|
|
|
|
ksort($ranks);
|
|
|
|
foreach ($data as &$ranks){
|
|
|
|
ksort($ranks);
|
|
|
|
// foreach ($ranks as &$rank){
|
|
|
|
// //处理排名
|
|
|
|
// if(!in_array($project_id, $without_project_ids)){
|
|
...
|
...
|
@@ -439,30 +438,30 @@ class RankDataLogic extends BaseLogic |
|
|
|
// //todo 需要特殊处理排名的项目
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
$last = Arr::last($ranks);
|
|
|
|
//第一名
|
|
|
|
if($last['position'] == 1){
|
|
|
|
$first_num ++;
|
|
|
|
}
|
|
|
|
//排名第一页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 10){
|
|
|
|
$first_page_num ++;
|
|
|
|
}
|
|
|
|
//排名前三页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 30){
|
|
|
|
$first_three_pages_num ++;
|
|
|
|
}
|
|
|
|
//排名前五页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 50){
|
|
|
|
$first_five_pages_num ++;
|
|
|
|
}
|
|
|
|
//排名前十页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 100){
|
|
|
|
$first_ten_pages_num ++;
|
|
|
|
}
|
|
|
|
$last = Arr::last($ranks);
|
|
|
|
//第一名
|
|
|
|
if($last['position'] == 1){
|
|
|
|
$first_num ++;
|
|
|
|
}
|
|
|
|
//排名第一页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 10){
|
|
|
|
$first_page_num ++;
|
|
|
|
}
|
|
|
|
//排名前三页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 30){
|
|
|
|
$first_three_pages_num ++;
|
|
|
|
}
|
|
|
|
//排名前五页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 50){
|
|
|
|
$first_five_pages_num ++;
|
|
|
|
}
|
|
|
|
//排名前十页
|
|
|
|
if($last['position'] > 0 && $last['position'] <= 100){
|
|
|
|
$first_ten_pages_num ++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$where = [
|
|
|
|
'project_id' => $project_id,
|
|
|
|
'lang' => $lang
|
|
...
|
...
|
@@ -479,6 +478,7 @@ class RankDataLogic extends BaseLogic |
|
|
|
$keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num');
|
|
|
|
$type = Project::where('id', $project_id)->value('type');
|
|
|
|
if($keyword_num && $type == Project::TYPE_TWO && $first_page_num >= $keyword_num){
|
|
|
|
Log::channel('rank_data')->info('项目'.$project_id.':关键词达标-'.$first_page_num);
|
|
|
|
$model->compliance_day = $model->compliance_day + 1;
|
|
|
|
$model->is_compliance = 1;
|
|
|
|
//项目表更新
|
|
...
|
...
|
@@ -486,6 +486,8 @@ class RankDataLogic extends BaseLogic |
|
|
|
$compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0;
|
|
|
|
Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day+1]);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
Log::channel('rank_data')->info('项目'.$project_id.':关键词未达标-'.$first_page_num);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$model->project_id = $project_id;
|
...
|
...
|
|