作者 李宇航

合并分支 'lyh-server' 到 'master'

geo设置



查看合并请求 !2322
... ... @@ -72,7 +72,7 @@ class GeoQuestionResController extends BaseController
'project_id.required' => 'project_id不能为空',
'type.required' => '品牌类型不能为空'
]);
$data = $this->logic->getResultList($this->map,$this->page,$this->row,$this->order);
$data = $this->logic->getResultList($this->map,$this->page,$this->row);
$this->response('success',Code::SUCCESS,$data);
}
... ...
... ... @@ -29,9 +29,10 @@ class GeoQuestionResLogic extends BaseLogic
* @time :2025/7/8 17:16
*/
public function getCount(){
$total = $this->model->counts(['project_id'=>$this->user['project_id']]);
$type_1 = $this->model->counts(['type'=>1,'project_id'=>$this->user['project_id']]);
$type_2 = $this->model->counts(['type'=>2,'project_id'=>$this->user['project_id']]);
return $this->success(['type_1'=>$type_1,'type_2'=>$type_2]);
return $this->success(['total'=>$total,'type_1'=>$type_1,'type_2'=>$type_2]);
}
/**
... ... @@ -41,20 +42,11 @@ class GeoQuestionResLogic extends BaseLogic
* @method :post
* @time :2025/7/4 9:48
*/
public function getResultList($map = [],$page = 1,$row = 20,$order = 'id'){
public function getResultList($map = [],$page = 1,$row = 20){
$filed = ['id','project_id','question_id','platform','question','keywords','url','created_at','updated_at'];
$result = GeoQuestionResult::select($filed)
->where($map)
->where(function($query) {
$query->where('keywords', '!=', '[]')
->orWhere('url', '!=', '[]');
})
->orderByRaw('LENGTH(question) ASC')
->paginate($row, $filed, 'page', $page);
$data = empty($result) ? [] : $result->toArray();
// $filed = ['id','project_id','question_id','platform','question','keywords','url','created_at','updated_at'];
// $data = $this->model->lists($map,$page,$row,$order,$filed);
$map['keywords'] = ['!=','[]'];
$map['url'] = ['!=','[]'];
$data = $this->model->formatQuery($map)->orderByRaw('CHAR_LENGTH(question) asc')->paginate($row, $filed, 'page', $page);
return $this->success($data);
}
... ...