正在显示
1 个修改的文件
包含
11 行增加
和
1 行删除
| @@ -90,12 +90,19 @@ class GeoQuestionResLogic extends BaseLogic | @@ -90,12 +90,19 @@ 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 | + if($this->user['project_id'] == 4533){ | ||
| 101 | + //核心问题数 | ||
| 102 | + if(strpos($item['label'],'核心问题') !== false){ | ||
| 103 | + $core_question_count += count($item['question'] ?? []); | ||
| 104 | + } | ||
| 105 | + } | ||
| 99 | $keywordsTotalCount += count($item['keywords'] ?? []); | 106 | $keywordsTotalCount += count($item['keywords'] ?? []); |
| 100 | $urlTotalCount += count($item['url'] ?? []); | 107 | $urlTotalCount += count($item['url'] ?? []); |
| 101 | foreach ($item['keywords'] as $keyWordItem){ | 108 | foreach ($item['keywords'] as $keyWordItem){ |
| @@ -110,7 +117,10 @@ class GeoQuestionResLogic extends BaseLogic | @@ -110,7 +117,10 @@ class GeoQuestionResLogic extends BaseLogic | ||
| 110 | 'question_count'=>$questionTotalCount, | 117 | 'question_count'=>$questionTotalCount, |
| 111 | 'keywords_url_count'=>$keywordUrlCount, | 118 | 'keywords_url_count'=>$keywordUrlCount, |
| 112 | 'keywords_arr' => $keywordArr, | 119 | 'keywords_arr' => $keywordArr, |
| 120 | + 'core_question_count'=>$core_question_count, | ||
| 121 | + 'core_keyword_url_count'=>$coreKeywordUrlCount | ||
| 113 | ]; | 122 | ]; |
| 123 | + | ||
| 114 | return $this->success($data); | 124 | return $this->success($data); |
| 115 | } | 125 | } |
| 116 | 126 |
-
请 注册 或 登录 后发表评论