作者 lyh

gx

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