作者 lyh

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

... ... @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
protected $description = '升级项目统计';
public function handle(){
$project_id = 450;
$project_id = 759;
ProjectServer::useProject($project_id);
$this->count($project_id);
DB::disconnect('custom_mysql');
... ...
... ... @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command
protected $description = '升级项目统计';
public function handle(){
$project_id = 450;
$project_id = 759;
$oldModel = new UpdateOldInfo();
$info = $oldModel->read(['project_id'=>$project_id]);
$url = $info['old_domain_online'];
... ...
... ... @@ -50,14 +50,21 @@ class RankDataTask extends Command
public function handle()
{
$list = NoticeLog::where('type', NoticeLog::TYPE_RANK_DATA)->where('status', NoticeLog::STATUS_PENDING)->get();
foreach ($list as $item){
foreach ($list as $item) {
echo 'start:' . $item['id'] . PHP_EOL;
try {
$error_msg = [];
$rankDataLogic = new RankDataLogic();
try {
//排名数据
$api = new QuanqiusouApi();
$site_res = $api->getSiteRes();
$rankDataLogic->syncRankData($item['data']['api_no'], $site_res, true);
} catch (\Exception $e) {
Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item->toArray());
$error_msg[] = $e->getMessage();
}
try {
//外链数据
$rankDataLogic->syncExternalLinks($item['data']['api_no'], true);
//外链引荐域名
... ... @@ -70,10 +77,14 @@ class RankDataTask extends Command
$item->status = NoticeLog::STATUS_SUCCESS;
$item->save();
echo 'success:' . $item['id'] . PHP_EOL;
}catch (\Exception $e){
} catch (\Exception $e){
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item);
$this->retry($item, $e->getMessage());
Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item->toArray());
$error_msg[] = $e->getMessage();
}
if($error_msg){
$this->retry($item, implode(',', $error_msg));
}
}
}
... ...