作者 周海龙

合并分支 'zhl' 到 'master'

Zhl



查看合并请求 !1886
@@ -67,10 +67,14 @@ class SendKeyword extends Command @@ -67,10 +67,14 @@ class SendKeyword extends Command
67 $send_num = [30 => 1000, 50 => 2000, 60 => 4000, 70 => 6000]; 67 $send_num = [30 => 1000, 50 => 2000, 60 => 4000, 70 => 6000];
68 $ban_domain = $this->banDomain(); 68 $ban_domain = $this->banDomain();
69 foreach ($projects as $item) { 69 foreach ($projects as $item) {
70 - if (empty($item->is_auto_keywords)) 70 + if (empty($item->is_auto_keywords)) {
  71 + $this->output('项目ID:' . $item->id . ', 未开启推送配置;');
71 continue; 72 continue;
72 - if (in_array($item->domain, $ban_domain)) 73 + }
  74 + if (in_array($item->domain, $ban_domain)) {
  75 + $this->output('项目ID:' . $item->id . ', 域名被禁用;');
73 continue; 76 continue;
  77 + }
74 if (empty($item->api_no)) { 78 if (empty($item->api_no)) {
75 $this->output('项目ID:' . $item->id . ', api_no为空;'); 79 $this->output('项目ID:' . $item->id . ', api_no为空;');
76 continue; 80 continue;
@@ -89,11 +93,15 @@ class SendKeyword extends Command @@ -89,11 +93,15 @@ class SendKeyword extends Command
89 93
90 // 项目是否达标 94 // 项目是否达标
91 $compliance = RankData::where(['project_id' => $item->id, 'api_no' => $item->api_no, 'lang' => ''])->value('is_compliance'); 95 $compliance = RankData::where(['project_id' => $item->id, 'api_no' => $item->api_no, 'lang' => ''])->value('is_compliance');
92 - if (FALSE == empty($compliance))  
93 - return false; 96 + if (FALSE == empty($compliance)) {
  97 + $this->output('项目ID:' . $item->id . ', 项目已达标,不需要推送;');
  98 + continue;
  99 + }
  100 +
94 101
95 $project = ProjectServer::useProject($item->id); 102 $project = ProjectServer::useProject($item->id);
96 if (empty($project)) { 103 if (empty($project)) {
  104 + $this->output('项目ID:' . $item->id . ', 项目链接失败;');
97 DB::disconnect('custom_mysql'); 105 DB::disconnect('custom_mysql');
98 continue; 106 continue;
99 } 107 }
@@ -109,6 +117,7 @@ class SendKeyword extends Command @@ -109,6 +117,7 @@ class SendKeyword extends Command
109 $item['apino'] = $item['api_no']; 117 $item['apino'] = $item['api_no'];
110 $this->sendNotice($item); 118 $this->sendNotice($item);
111 } 119 }
  120 + $this->output('项目ID:' . $item['id'] . ', ' . ($send ? '推送完成' : '无推送关键词;'));
112 } 121 }
113 return true; 122 return true;
114 } 123 }