Skip to content

Commit ee62e8c

Browse files
committed
fix
1 parent 6d0e6ec commit ee62e8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/Http/Controllers/Traits/ResourceController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function getList()
370370
//获取分页数据
371371
if (!$request->input('page') || $request->input('get_count')) {
372372
if($real_page>1 && $request->input('where.'.$primary_key)){
373-
$total = $this->getWithOptionModel('showIndexFields',true,true)->count();
373+
$total = $this->getWithOptionModel('showIndexFields',true,true,true)->count();
374374
if($total>0){
375375
$data = (clone $obj)->simplePaginate($perPage);
376376
$data = collect($data)->toArray();
@@ -571,9 +571,11 @@ protected function one($id = null)
571571
* 获取条件拼接对象
572572
* @return mixed
573573
*/
574-
protected function getWithOptionModel($fields_key = 'showIndexFields',$unset_order=false,$unset_where_primary_key=false)
574+
protected function getWithOptionModel($fields_key = 'showIndexFields',$unset_order=false,$unset_where_primary_key=false,$clear=false)
575575
{
576-
$this->bindModel = null;
576+
if($clear){
577+
$this->bindModel = null;
578+
}
577579
$this->bindModel();
578580
$options = $this->getOptions($unset_where_primary_key); //筛选项+排序项
579581
if($unset_order){

0 commit comments

Comments
 (0)