作者 lyh

gx

@@ -36,16 +36,9 @@ class InitKeywordComment extends Command @@ -36,16 +36,9 @@ class InitKeywordComment extends Command
36 public $number = 100; 36 public $number = 100;
37 37
38 public function handle(){ 38 public function handle(){
39 - $projectModel = new Project();  
40 - $lists = $projectModel->list(['delete_status' => 0,'id'=>['<',1368],'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']);  
41 - foreach ($lists as $val) {  
42 - echo date('Y-m-d H:i:s') . '开始--项目的id:' . $val['id'] . PHP_EOL;  
43 - $this->_action($val['id']);  
44 - }  
45 - return true;  
46 $keywordCommentModel = new AggregateKeywordComment(); 39 $keywordCommentModel = new AggregateKeywordComment();
47 while (true){ 40 while (true){
48 - $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMON)->where('status', NoticeLog::STATUS_PENDING)->get(); 41 + $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMENT)->where('status', NoticeLog::STATUS_PENDING)->get();
49 if(empty($list)){ 42 if(empty($list)){
50 sleep(200); 43 sleep(200);
51 continue; 44 continue;
@@ -432,7 +432,7 @@ class ProjectLogic extends BaseLogic @@ -432,7 +432,7 @@ class ProjectLogic extends BaseLogic
432 $keywordCommentModel = new AggregateKeywordComment(); 432 $keywordCommentModel = new AggregateKeywordComment();
433 $commentNum = $keywordCommentModel->counts(['project_id'=>$param['id']]); 433 $commentNum = $keywordCommentModel->counts(['project_id'=>$param['id']]);
434 if(empty($commentNum)){ 434 if(empty($commentNum)){
435 - NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD_COMMON, ['project_id' => $param['id']]); 435 + NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD_COMMENT, ['project_id' => $param['id']]);
436 } 436 }
437 } 437 }
438 if($param['type'] == Project::TYPE_FIVE){ 438 if($param['type'] == Project::TYPE_FIVE){
@@ -13,7 +13,7 @@ class NoticeLog extends Base @@ -13,7 +13,7 @@ class NoticeLog extends Base
13 const TYPE_PROJECT = 'project'; 13 const TYPE_PROJECT = 'project';
14 const TYPE_RANK_DATA = 'rank_data'; 14 const TYPE_RANK_DATA = 'rank_data';
15 const TYPE_INIT_PROJECT = 'init_project'; 15 const TYPE_INIT_PROJECT = 'init_project';
16 - const TYPE_INIT_KEYWORD_COMMON = 'init_keyword_common';//聚合页关键词评论 16 + const TYPE_INIT_KEYWORD_COMMENT = 'init_keyword_comment';//聚合页关键词评论
17 const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成 17 const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成
18 const TYPE_COPY_PROJECT = 'copy_project'; 18 const TYPE_COPY_PROJECT = 'copy_project';
19 const TYPE_INIT_KEYWORD = 'init_keyword'; 19 const TYPE_INIT_KEYWORD = 'init_keyword';