@@ -361,15 +361,9 @@ protected function existFullTextSearch(){
361
361
return $ this ->hasFullTextSearch ;
362
362
}
363
363
364
- /**
365
- * 获取翻页数据
366
- */
367
- public function getList ()
368
- {
369
- $ this ->selectValidate ();
370
- $ this ->bindModel = $ this ->bindModel ();
364
+ protected function selectIndexFields (&$ query ,&$ fields =[],&$ primary_key ='' ){
371
365
//指定查询字段
372
- $ fields = $ this ->selectFields ($ this ->showIndexFields ,$ this -> bindModel );
366
+ $ fields = $ this ->selectFields ($ this ->showIndexFields ,$ query );
373
367
//判断是否包含主键字段,没有包含自动添加
374
368
$ model = $ this ->newBindModel ();
375
369
$ primary_key = $ model ->getKeyName ();
@@ -388,9 +382,22 @@ public function getList()
388
382
}
389
383
$ hasFullTextSearch = $ this ->existFullTextSearch ();
390
384
if ($ fields && !$ hasFullTextSearch ){
391
- $ this -> bindModel = $ this -> bindModel ->select ($ fields );
385
+ $ query = $ query ->select ($ fields );
392
386
}
387
+ return $ query ;
388
+ }
393
389
390
+ /**
391
+ * 获取翻页数据
392
+ */
393
+ public function getList ()
394
+ {
395
+ $ this ->selectValidate ();
396
+ $ this ->bindModel = $ this ->bindModel ();
397
+ $ primary_key = '' ;
398
+ $ fields = [];
399
+ $ hasFullTextSearch = $ this ->existFullTextSearch ();
400
+ $ this ->bindModel = $ this ->selectIndexFields ($ this ->bindModel ,$ fields ,$ primary_key );
394
401
//获取带有筛选条件的对象
395
402
$ obj = $ this ->getWithOptionModel ();
396
403
$ obj = $ this ->handleList ($ obj );
0 commit comments