作者 lyh

GXgeo设置

@@ -44,18 +44,9 @@ class GeoQuestionResLogic extends BaseLogic @@ -44,18 +44,9 @@ class GeoQuestionResLogic extends BaseLogic
44 */ 44 */
45 public function getResultList($map = [],$page = 1,$row = 20,$order = 'id'){ 45 public function getResultList($map = [],$page = 1,$row = 20,$order = 'id'){
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 - $result = GeoQuestionResult::select($filed)  
48 - ->where($map)  
49 - ->where(function($query) {  
50 - $query->where('keywords', '!=', '[]')  
51 - ->orWhere('url', '!=', '[]');  
52 - })  
53 - ->orderByRaw('LENGTH(question) ASC')  
54 - ->paginate($row, $filed, 'page', $page);  
55 - $data = empty($result) ? [] : $result->toArray();  
56 -  
57 -// $filed = ['id','project_id','question_id','platform','question','keywords','url','created_at','updated_at'];  
58 -// $data = $this->model->lists($map,$page,$row,$order,$filed); 47 + $map['keywords'] = ['!=','[]'];
  48 + $map['url'] = ['!=','[]'];
  49 + $data = $this->model->formatQuery($map)->orderByRaw('CHAR_LENGTH(question) asc')->paginate($row, $filed, 'page', $page);
59 return $this->success($data); 50 return $this->success($data);
60 } 51 }
61 52