合并分支 'lyh-server' 到 'master'
GXgeo设置 查看合并请求 !2323
正在显示
1 个修改的文件
包含
6 行增加
和
3 行删除
| @@ -44,9 +44,12 @@ class GeoQuestionResLogic extends BaseLogic | @@ -44,9 +44,12 @@ class GeoQuestionResLogic extends BaseLogic | ||
| 44 | */ | 44 | */ |
| 45 | public function getResultList($map = [],$page = 1,$row = 20){ | 45 | public function getResultList($map = [],$page = 1,$row = 20){ |
| 46 | $filed = ['id','project_id','question_id','platform','question','keywords','url','created_at','updated_at']; | 46 | $filed = ['id','project_id','question_id','platform','question','keywords','url','created_at','updated_at']; |
| 47 | - $map['keywords'] = ['!=','[]']; | ||
| 48 | - $map['url'] = ['!=','[]']; | ||
| 49 | - $data = $this->model->formatQuery($map)->orderByRaw('CHAR_LENGTH(question) asc')->paginate($row, $filed, 'page', $page); | 47 | + $query = $this->model->formatQuery($map); |
| 48 | + $query = $query->where(function ($q) { | ||
| 49 | + $q->whereRaw('JSON_LENGTH(keywords) > 0') | ||
| 50 | + ->orWhereRaw('JSON_LENGTH(url) > 0'); | ||
| 51 | + }); | ||
| 52 | + $data = $query->orderByRaw('CHAR_LENGTH(question) ASC')->paginate($row, $filed, 'page', $page);; | ||
| 50 | return $this->success($data); | 53 | return $this->success($data); |
| 51 | } | 54 | } |
| 52 | 55 |
-
请 注册 或 登录 后发表评论