|
...
|
...
|
@@ -135,16 +135,23 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
];
|
|
|
|
}else{
|
|
|
|
$keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]);
|
|
|
|
$keywordArrs = [];
|
|
|
|
$urlArrs = [];
|
|
|
|
foreach ($list as $item){
|
|
|
|
$keywordArrs = array_merge($keywordArrs,$item['keywords'] ?? []);
|
|
|
|
$urlArrs = array_merge($urlArrs,$item['url'] ??[]);
|
|
|
|
$questionTotalCount += count($item['question'] ?? []);
|
|
|
|
$keywordsTotalCount += count($item['keywords'] ?? []);
|
|
|
|
$urlTotalCount += count($item['url'] ?? []);
|
|
|
|
foreach ($item['keywords'] as $keyWordItem){
|
|
|
|
if (!array_key_exists($keyWordItem, $keywordArr)) {
|
|
|
|
$keywordArr[$keyWordItem] = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'keywords'=>['like','%"'.$keyWordItem.'"%']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 去重
|
|
|
|
$keywordArrs = array_unique($keywordArrs);
|
|
|
|
$keywordsTotalCount = count($keywordArrs);
|
|
|
|
$urlArrs = array_unique($urlArrs);
|
|
|
|
$urlTotalCount = count($urlArrs);
|
|
|
|
$data = [
|
|
|
|
'question_count'=>$questionTotalCount,
|
|
|
|
'keywords_count'=>$keywordsTotalCount,
|
...
|
...
|
|