合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !2628
正在显示
1 个修改的文件
包含
9 行增加
和
1 行删除
| @@ -90,12 +90,17 @@ class GeoQuestionResLogic extends BaseLogic | @@ -90,12 +90,17 @@ class GeoQuestionResLogic extends BaseLogic | ||
| 90 | public function countQuantity(){ | 90 | public function countQuantity(){ |
| 91 | $questionModel = new GeoQuestion(); | 91 | $questionModel = new GeoQuestion(); |
| 92 | $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']); | 92 | $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']); |
| 93 | - $questionTotalCount = $urlTotalCount = $keywordsTotalCount = $keywordUrlCount = 0; | 93 | + $core_question_count = $questionTotalCount = $urlTotalCount = $keywordsTotalCount = 0; |
| 94 | $keywordArr = []; | 94 | $keywordArr = []; |
| 95 | $questionLogModel = new GeoQuestionLog(); | 95 | $questionLogModel = new GeoQuestionLog(); |
| 96 | $keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]); | 96 | $keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]); |
| 97 | + $coreKeywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'label'=>['like','%核心问题%'],'hit'=>['!=',0]]); | ||
| 97 | foreach ($list as $item){ | 98 | foreach ($list as $item){ |
| 98 | $questionTotalCount += count($item['question'] ?? []); | 99 | $questionTotalCount += count($item['question'] ?? []); |
| 100 | + //核心问题数 | ||
| 101 | + if(strpos($item['label'],'核心问题') !== false){ | ||
| 102 | + $core_question_count += count($item['question'] ?? []); | ||
| 103 | + } | ||
| 99 | $keywordsTotalCount += count($item['keywords'] ?? []); | 104 | $keywordsTotalCount += count($item['keywords'] ?? []); |
| 100 | $urlTotalCount += count($item['url'] ?? []); | 105 | $urlTotalCount += count($item['url'] ?? []); |
| 101 | foreach ($item['keywords'] as $keyWordItem){ | 106 | foreach ($item['keywords'] as $keyWordItem){ |
| @@ -110,7 +115,10 @@ class GeoQuestionResLogic extends BaseLogic | @@ -110,7 +115,10 @@ class GeoQuestionResLogic extends BaseLogic | ||
| 110 | 'question_count'=>$questionTotalCount, | 115 | 'question_count'=>$questionTotalCount, |
| 111 | 'keywords_url_count'=>$keywordUrlCount, | 116 | 'keywords_url_count'=>$keywordUrlCount, |
| 112 | 'keywords_arr' => $keywordArr, | 117 | 'keywords_arr' => $keywordArr, |
| 118 | + 'core_question_count'=>$core_question_count, | ||
| 119 | + 'core_keyword_url_count'=>$coreKeywordUrlCount | ||
| 113 | ]; | 120 | ]; |
| 121 | + | ||
| 114 | return $this->success($data); | 122 | return $this->success($data); |
| 115 | } | 123 | } |
| 116 | 124 |
-
请 注册 或 登录 后发表评论