|
...
|
...
|
@@ -12,6 +12,7 @@ namespace App\Http\Logic\Bside\Geo; |
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\Geo\GeoPlatform;
|
|
|
|
use App\Models\Geo\GeoQuestion;
|
|
|
|
use App\Models\Geo\GeoQuestionLog;
|
|
|
|
use App\Models\Geo\GeoQuestionResult;
|
|
|
|
|
|
|
|
class GeoQuestionResLogic extends BaseLogic
|
|
...
|
...
|
@@ -122,4 +123,37 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
}
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取搜索时间
|
|
|
|
* @name :getSearchDate
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/21 16:36
|
|
|
|
*/
|
|
|
|
public function getSearchDate(){
|
|
|
|
$dates = $this->model->select(DB::raw('DATE(created_at) as date_only'))->distinct()->pluck('date_only');
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|