|
...
|
...
|
@@ -88,19 +88,17 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
$questionModel = new GeoQuestion();
|
|
|
|
$list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']);
|
|
|
|
$questionTotalCount = $urlTotalCount = $keywordsTotalCount = $keywordUrlCount = 0;
|
|
|
|
$keywordArr = [];
|
|
|
|
$questionLogModel = new GeoQuestionLog();
|
|
|
|
$keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]);
|
|
|
|
foreach ($list as $item){
|
|
|
|
$questionTotalCount += count($item['question'] ?? []);
|
|
|
|
$keywordsTotalCount += count($item['keywords'] ?? []);
|
|
|
|
$urlTotalCount += count($item['url'] ?? []);
|
|
|
|
}
|
|
|
|
$keywordArr = [];
|
|
|
|
$questionResModel = new GeoQuestionLog();
|
|
|
|
$resList = $questionResModel->list(['project_id'=>$this->user['project_id']],['keywords','url','keywords_num','url_num']);
|
|
|
|
foreach ($resList as $resItem){
|
|
|
|
$keywordUrlCount += count($resItem['keywords']);
|
|
|
|
$keywordUrlCount += count($resItem['url']);
|
|
|
|
foreach ($resItem['keywords_num'] as $key => $value) {
|
|
|
|
$keywordArr[$key] = ($keywordArr[$key] ?? 0) + (($value != 0) ? 1 : 0);
|
|
|
|
foreach ($item['keywords'] as $keyWordItem){
|
|
|
|
if (!array_key_exists($keyWordItem, $keywordArr)) {
|
|
|
|
$keywordArr[$keyWordItem] = $questionLogModel->counts(['keywords'=>['like','%"'.$keyWordItem.'"%']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data = [
|
|
...
|
...
|
@@ -124,7 +122,7 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
$data = [];
|
|
|
|
$platformModel = new GeoPlatform();
|
|
|
|
$list = $platformModel->list(['status'=>1],'id',['name','en_name']);
|
|
|
|
$questionResModel = new GeoQuestionResult();
|
|
|
|
$questionResModel = new GeoQuestionLog();
|
|
|
|
foreach ($list as $item){
|
|
|
|
$data[$item['name']] = $questionResModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0],'platform'=>$item['en_name']]);
|
|
|
|
}
|
...
|
...
|
|