作者 lyh

gx

@@ -37,8 +37,13 @@ class GoogleSearchController extends BaseController @@ -37,8 +37,13 @@ class GoogleSearchController extends BaseController
37 if($searchInfo === false){ 37 if($searchInfo === false){
38 //获取当前项目域名 38 //获取当前项目域名
39 $domain = parse_url($this->user['domain'], PHP_URL_HOST); 39 $domain = parse_url($this->user['domain'], PHP_URL_HOST);
40 - $data = NoticeLog::createLog(NoticeLog::GOOGLE_SEARCH, ['project_id' => $this->user['project_id'],'domain'=>$domain,'type'=>$this->param['type']]);  
41 - $this->response('数据更新时间为7天,新数据生成中,请2小时后查看...',Code::SUCCESS,$data); 40 + $noticeModel = new NoticeLog();
  41 + $info = $noticeModel->read(['project_id' => $this->user['project_id'],'domain'=>$domain,'type'=>$this->param['type'],'status'=>NoticeLog::STATUS_PENDING]);
  42 + if($info === false){
  43 + $noticeModel->addReturnId(['data'=>json_encode(['project_id' => $this->user['project_id'],'domain'=>$domain,'type'=>$this->param['type']],true
  44 + ),'type'=>$noticeModel::GOOGLE_SEARCH]);
  45 + }
  46 + $this->response('数据更新时间为7天,新数据生成中...',Code::SUCCESS);
42 } 47 }
43 //查询详情数据 48 //查询详情数据
44 $searchDetailModel = new GoogleSearchDetail(); 49 $searchDetailModel = new GoogleSearchDetail();