作者 lyh

gx数据

... ... @@ -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);
}
}
... ...
... ... @@ -756,8 +756,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/getType', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getType'])->name('geo_result_getType');//geo设置类型
Route::any('/getCount', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getCount'])->name('geo_result_getCount');//geo设置类型统计数量
Route::any('/countQuantity', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'countQuantity'])->name('geo_result_countQuantity');//geo统计
Route::any('/getSearchDate', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getSearchDate'])->name('geo_result_getSearchDate');//geo获取请求时间的记录
Route::any('/getSearchList', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getSearchList'])->name('geo_result_getSearchList');//搜索记录列表
Route::any('/getSearchDate', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getSearchDate'])->name('geo_result_getSearchDate');//搜索记录时间
});
});
//无需登录验证的路由组
... ...