作者 lyh

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

@@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
33 protected $description = '升级项目统计'; 33 protected $description = '升级项目统计';
34 34
35 public function handle(){ 35 public function handle(){
36 - $project_id = 450; 36 + $project_id = 759;
37 ProjectServer::useProject($project_id); 37 ProjectServer::useProject($project_id);
38 $this->count($project_id); 38 $this->count($project_id);
39 DB::disconnect('custom_mysql'); 39 DB::disconnect('custom_mysql');
@@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command
36 protected $description = '升级项目统计'; 36 protected $description = '升级项目统计';
37 37
38 public function handle(){ 38 public function handle(){
39 - $project_id = 450; 39 + $project_id = 759;
40 $oldModel = new UpdateOldInfo(); 40 $oldModel = new UpdateOldInfo();
41 $info = $oldModel->read(['project_id'=>$project_id]); 41 $info = $oldModel->read(['project_id'=>$project_id]);
42 $url = $info['old_domain_online']; 42 $url = $info['old_domain_online'];
@@ -50,14 +50,21 @@ class RankDataTask extends Command @@ -50,14 +50,21 @@ class RankDataTask extends Command
50 public function handle() 50 public function handle()
51 { 51 {
52 $list = NoticeLog::where('type', NoticeLog::TYPE_RANK_DATA)->where('status', NoticeLog::STATUS_PENDING)->get(); 52 $list = NoticeLog::where('type', NoticeLog::TYPE_RANK_DATA)->where('status', NoticeLog::STATUS_PENDING)->get();
53 - foreach ($list as $item){ 53 + foreach ($list as $item) {
54 echo 'start:' . $item['id'] . PHP_EOL; 54 echo 'start:' . $item['id'] . PHP_EOL;
  55 + $error_msg = [];
  56 + $rankDataLogic = new RankDataLogic();
55 try { 57 try {
56 - $rankDataLogic = new RankDataLogic();  
57 //排名数据 58 //排名数据
58 $api = new QuanqiusouApi(); 59 $api = new QuanqiusouApi();
59 $site_res = $api->getSiteRes(); 60 $site_res = $api->getSiteRes();
60 $rankDataLogic->syncRankData($item['data']['api_no'], $site_res, true); 61 $rankDataLogic->syncRankData($item['data']['api_no'], $site_res, true);
  62 + } catch (\Exception $e) {
  63 + Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item->toArray());
  64 + $error_msg[] = $e->getMessage();
  65 + }
  66 +
  67 + try {
61 //外链数据 68 //外链数据
62 $rankDataLogic->syncExternalLinks($item['data']['api_no'], true); 69 $rankDataLogic->syncExternalLinks($item['data']['api_no'], true);
63 //外链引荐域名 70 //外链引荐域名
@@ -70,10 +77,14 @@ class RankDataTask extends Command @@ -70,10 +77,14 @@ class RankDataTask extends Command
70 $item->status = NoticeLog::STATUS_SUCCESS; 77 $item->status = NoticeLog::STATUS_SUCCESS;
71 $item->save(); 78 $item->save();
72 echo 'success:' . $item['id'] . PHP_EOL; 79 echo 'success:' . $item['id'] . PHP_EOL;
73 - }catch (\Exception $e){ 80 + } catch (\Exception $e){
74 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL; 81 echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
75 - Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item);  
76 - $this->retry($item, $e->getMessage()); 82 + Log::channel('rank_data')->error('排名数据更新失败' . $e->getMessage(), $item->toArray());
  83 + $error_msg[] = $e->getMessage();
  84 + }
  85 +
  86 + if($error_msg){
  87 + $this->retry($item, implode(',', $error_msg));
77 } 88 }
78 } 89 }
79 } 90 }