作者 李宇航

合并分支 'lyh-server' 到 'master'

gx暂停优化项目



查看合并请求 !1850
... ... @@ -7,6 +7,7 @@ use App\Models\RankData\RankDataLog as RankDataLogModel;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Project;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/**
... ... @@ -47,8 +48,19 @@ class RankData extends BaseCommands
Project::where('is_remain_today', 1)->update(['is_remain_today' => 0]);
Cache::set('clear_remain_today_' . date('Y-m-d'), 1, 24 * 3600);
}
$projectModel = new Project();
$list = $projectModel->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
->where('gl_project.extend_type',0)
->where('gl_project.delete_status',0)
->where('gl_project_deploy_optimize.api_no', '>', 0)
->whereIn('gl_project.type',[2,4])
->whereRaw("FIND_IN_SET('2', gl_project.level) = 0 AND FIND_IN_SET('3', gl_project.level) = 0")
->select(['gl_project_deploy_optimize.api_no as api_no', 'gl_project_deploy_optimize.project_id as project_id'])
->orderBy('gl_project.id', 'asc')
->get()->toArray();
//有排名api编号的项目
$list = DeployOptimize::where('api_no', '>', 0)->select('api_no', 'project_id')->orderBy('project_id', 'asc')->get()->toArray();
// $list = DeployOptimize::where('api_no', '>', 0)->select('api_no', 'project_id')->orderBy('project_id', 'asc')->get()->toArray();
//特殊项目 一个项目多个apino
$list[] = ['api_no' => 11201, 'project_id' => 2104];
$list[] = ['api_no' => 10690, 'project_id' => 2104];
... ...
... ... @@ -53,9 +53,11 @@ use App\Services\DingService;
use App\Services\ProjectServer;
use App\Services\SyncService;
use App\Utils\LogUtils;
use AWS\CRT\Log;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log as LogInfo;
/**
* Class ProjectLogic
... ... @@ -162,7 +164,7 @@ class ProjectLogic extends BaseLogic
if($this->param['type'] == Project::TYPE_SEVEN){
$this->setTypeSevenEdit($this->param);
}else{
$this->param = $this->handleLevelStr($this->param);//处理星级客户暂停优化
$this->param = $this->handleLevelStr($this->param);//处理星级客户暂停优化默认参数
$this->saveSeoPlan($this->param);//保存seo白帽类型,上线保存一条审核记录
$this->checkAiBlog($this->param);//开启白帽验证参数
DB::beginTransaction();
... ... @@ -194,6 +196,7 @@ class ProjectLogic extends BaseLogic
(new SyncService())->projectAcceptAddress($this->param['id']);
DB::commit();
}catch (\Exception $e){
LogInfo::info('项目保存失败:project_id'.$this->param['id'].',错误详情:'.$e->getMessage(). PHP_EOL);
DB::rollBack();
$this->fail('保存失败,请联系管理员');
}
... ...
... ... @@ -62,7 +62,13 @@ class RankDataLogic extends BaseLogic
$external_links = ExternalLinks::where('project_id', $project_id)->where('api_no', $api_no)->first();
$indexed_pages = IndexedPages::where('project_id', $project_id)->where('api_no', $api_no)->first();
$speed = Speed::where('project_id', $project_id)->first();
//暂停优化的项目(排名数据显示横杠 - ,关键词排名第一页 、 关键词排名前十页 、 Google收录页面数 、 可查询外链数)
if(!empty($param['level'])){
$values = explode(',', $param['level']);
if (in_array('2', $values) || in_array('3', $values)) {
$rank['first_page_num'] = $rank['first_ten_pages_num'] = $rank['indexed_pages_num'] = $rank['external_links_num'] = '-';
}
}
//排名数据
$data = [
'first_num' => $rank['first_num'] ?? 0,
... ...