|
...
|
...
|
@@ -44,9 +44,12 @@ class GeoQuestionResLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function getResultList($map = [],$page = 1,$row = 20){
|
|
|
|
$filed = ['id','project_id','question_id','platform','question','keywords','url','created_at','updated_at'];
|
|
|
|
$map['keywords'] = ['!=','[]'];
|
|
|
|
$map['url'] = ['!=','[]'];
|
|
|
|
$data = $this->model->formatQuery($map)->orderByRaw('CHAR_LENGTH(question) asc')->paginate($row, $filed, 'page', $page);
|
|
|
|
$query = $this->model->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);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|