|
...
|
...
|
@@ -47,6 +47,11 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function getResultList($map = [],$page = 1,$row = 20){
|
|
|
|
$filed = ['id','project_id','question_id','platform','question','en_question','keywords','url','created_at','updated_at'];
|
|
|
|
if(!empty($map['created_at'])){
|
|
|
|
$map['project_id'] = $this->user['project_id'];
|
|
|
|
$map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].'23:59:59']];
|
|
|
|
$this->model = new GeoQuestionLog();
|
|
|
|
}
|
|
|
|
$query = $this->model->formatQuery($map);
|
|
|
|
$query = $query->where(function ($q) {
|
|
|
|
$q->whereRaw('JSON_LENGTH(keywords) > 0')
|
|
...
|
...
|
@@ -136,24 +141,4 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
return $this->success($dates);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取搜索列表
|
|
|
|
* @name :getSearchList
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/21 16:48
|
|
|
|
*/
|
|
|
|
public function getSearchList($map = [],$page = 1,$row = 20){
|
|
|
|
$filed = ['id','project_id','question_id','platform','question','en_question','keywords','url','created_at','updated_at'];
|
|
|
|
$map['project_id'] = $this->user['project_id'];
|
|
|
|
$map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].'23:59:59']];
|
|
|
|
$resLogModel = new GeoQuestionLog();
|
|
|
|
$query = $resLogModel->formatQuery($map);
|
|
|
|
$query = $query->where(function ($q) {
|
|
|
|
$q->whereRaw('JSON_LENGTH(keywords) > 0')
|
|
|
|
->orWhereRaw('JSON_LENGTH(url) > 0');
|
|
|
|
});
|
|
|
|
$data = $query->orderByRaw('CHAR_LENGTH(question) ASC')->paginate($row, $filed, 'page', $page);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|