作者 赵彬吉
@@ -145,6 +145,7 @@ class SyncInquiryProject extends Command @@ -145,6 +145,7 @@ class SyncInquiryProject extends Command
145 ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') 145 ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
146 ->where('gl_project.type', Project::TYPE_TWO) 146 ->where('gl_project.type', Project::TYPE_TWO)
147 ->where('gl_project.extend_type', '!=', 5) 147 ->where('gl_project.extend_type', '!=', 5)
  148 + ->where('gl_project.delete_status', Project::IS_DEL_FALSE)
148 ->where(function ($query) { 149 ->where(function ($query) {
149 $query->orwhere('gl_project_online_check.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) 150 $query->orwhere('gl_project_online_check.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)
150 ->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); 151 ->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE);
@@ -77,7 +77,7 @@ class GeoQuestionResController extends BaseController @@ -77,7 +77,7 @@ class GeoQuestionResController extends BaseController
77 } 77 }
78 78
79 /** 79 /**
80 - * @remark : 80 + * @remark :获取详情
81 * @name :getInfo 81 * @name :getInfo
82 * @author :lyh 82 * @author :lyh
83 * @method :post 83 * @method :post
@@ -68,6 +68,14 @@ class InquiryForwardLogic extends BaseLogic @@ -68,6 +68,14 @@ class InquiryForwardLogic extends BaseLogic
68 public function getInquiryLists($map, $page, $row, $order = 'id', $filed = ['*']) 68 public function getInquiryLists($map, $page, $row, $order = 'id', $filed = ['*'])
69 { 69 {
70 $lists = $this->model->lists($map, $page, $row, $order, $filed); 70 $lists = $this->model->lists($map, $page, $row, $order, $filed);
  71 +
  72 + //获取操作人
  73 + $manage_model = new Manage();
  74 + foreach ($lists['list'] as $k => $v) {
  75 + $manage_info = $manage_model->read(['id' => $v['operator_id']], ['name']);
  76 + $lists['list'][$k]['operator_name'] = $manage_info ? $manage_info['name'] : '';
  77 + }
  78 +
71 //统计各个状态询盘总数 79 //统计各个状态询盘总数
72 if (isset($map['status'])) { 80 if (isset($map['status'])) {
73 unset($map['status']); 81 unset($map['status']);
@@ -438,23 +446,6 @@ class InquiryForwardLogic extends BaseLogic @@ -438,23 +446,6 @@ class InquiryForwardLogic extends BaseLogic
438 { 446 {
439 $model = new InquiryRelayDetail(); 447 $model = new InquiryRelayDetail();
440 $lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']); 448 $lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']);
441 -  
442 - //获取操作人  
443 - $inquiry_info_model = new InquiryInfo();  
444 - $manage_model = new Manage();  
445 - foreach ($lists['list'] as $k => $v) {  
446 - $operator_name = '';  
447 - $inquiry_info = $inquiry_info_model->read(['id' => $v['form_id']], ['operator_id']);  
448 - if ($inquiry_info) {  
449 - $manage_info = $manage_model->read(['id' => $inquiry_info['operator_id']], ['name']);  
450 - if ($manage_info) {  
451 - $operator_name = $manage_info['name'];  
452 - }  
453 - }  
454 -  
455 - $lists['list'][$k]['operator_name'] = $operator_name;  
456 - }  
457 -  
458 return $this->success($lists); 449 return $this->success($lists);
459 } 450 }
460 451
@@ -98,7 +98,7 @@ class GeoQuestionResLogic extends BaseLogic @@ -98,7 +98,7 @@ class GeoQuestionResLogic extends BaseLogic
98 $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']); 98 $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']);
99 $core_question_count = $questionTotalCount = $urlTotalCount = $keywordsTotalCount = 0; 99 $core_question_count = $questionTotalCount = $urlTotalCount = $keywordsTotalCount = 0;
100 $keywordArr = []; 100 $keywordArr = [];
101 - $questionLogModel = new GeoQuestionLog(); 101 + $questionLogModel = new GeoQuestionResult();
102 if($this->user['project_id'] == 4533){ 102 if($this->user['project_id'] == 4533){
103 $keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'is_match'=>1,'hit'=>['!=',0]]); 103 $keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'is_match'=>1,'hit'=>['!=',0]]);
104 foreach ($list as $item){ 104 foreach ($list as $item){
@@ -141,8 +141,14 @@ class GeoQuestionResLogic extends BaseLogic @@ -141,8 +141,14 @@ class GeoQuestionResLogic extends BaseLogic
141 'keywords_url_count'=>$keywordUrlCount, 141 'keywords_url_count'=>$keywordUrlCount,
142 'keywords_arr' => $keywordArr, 142 'keywords_arr' => $keywordArr,
143 ]; 143 ];
144 - return $this->success($data); 144 +
145 } 145 }
  146 + //问题达标数据
  147 + $data['question_qualify_count'] = $questionLogModel->where('project_id', $this->user['project_id'])
  148 + ->where('hit','!=',0)->whereIn('platform',['openai', 'gemini','google_ai_overview'])
  149 + ->select(DB::raw('COUNT(DISTINCT question) as total'))
  150 + ->value('total');
  151 + return $this->success($data);
146 } 152 }
147 153
148 /** 154 /**
@@ -156,7 +162,7 @@ class GeoQuestionResLogic extends BaseLogic @@ -156,7 +162,7 @@ class GeoQuestionResLogic extends BaseLogic
156 $data = []; 162 $data = [];
157 $platformModel = new GeoPlatform(); 163 $platformModel = new GeoPlatform();
158 $list = $platformModel->list(['status'=>1],'id',['name','en_name']); 164 $list = $platformModel->list(['status'=>1],'id',['name','en_name']);
159 - $questionResModel = new GeoQuestionLog(); 165 + $questionResModel = new GeoQuestionResult();
160 foreach ($list as $item){ 166 foreach ($list as $item){
161 if($this->user['project_id'] == 4533){ 167 if($this->user['project_id'] == 4533){
162 $data[$item['name']] = $questionResModel->counts(['project_id'=>$this->user['project_id'],'is_match'=>1,'hit'=>['!=',0],'platform'=>$item['en_name']]); 168 $data[$item['name']] = $questionResModel->counts(['project_id'=>$this->user['project_id'],'is_match'=>1,'hit'=>['!=',0],'platform'=>$item['en_name']]);