作者 王智

daima

@@ -43,22 +43,20 @@ class Renwu extends Backend @@ -43,22 +43,20 @@ class Renwu extends Backend
43 $this->relationSearch = true; 43 $this->relationSearch = true;
44 //设置过滤方法 44 //设置过滤方法
45 $this->request->filter(['strip_tags', 'trim']); 45 $this->request->filter(['strip_tags', 'trim']);
46 - if ($this->request->isAjax())  
47 - { 46 + if ($this->request->isAjax()) {
48 //如果发送的来源是Selectpage,则转发到Selectpage 47 //如果发送的来源是Selectpage,则转发到Selectpage
49 - if ($this->request->request('keyField'))  
50 - { 48 + if ($this->request->request('keyField')) {
51 return $this->selectpage(); 49 return $this->selectpage();
52 } 50 }
53 list($where, $sort, $order, $offset, $limit) = $this->buildparams(); 51 list($where, $sort, $order, $offset, $limit) = $this->buildparams();
54 $total = $this->model 52 $total = $this->model
55 - ->with(['user','vip']) 53 + ->with(['user', 'vip'])
56 ->where($where) 54 ->where($where)
57 ->order($sort, $order) 55 ->order($sort, $order)
58 ->count(); 56 ->count();
59 57
60 $list = $this->model 58 $list = $this->model
61 - ->with(['user','vip']) 59 + ->with(['user', 'vip'])
62 ->where($where) 60 ->where($where)
63 ->order($sort, $order) 61 ->order($sort, $order)
64 ->limit($offset, $limit) 62 ->limit($offset, $limit)
@@ -66,7 +64,9 @@ class Renwu extends Backend @@ -66,7 +64,9 @@ class Renwu extends Backend
66 64
67 foreach ($list as $row) { 65 foreach ($list as $row) {
68 66
69 - $row->getRelation('user')->visible(['nickname','mobile','address','address_con','car_num','color','car_type','vip']); 67 + $row->getRelation('user')->visible(['nickname', 'mobile', 'address', 'address_con', 'car_num', 'color', 'car_type', 'vip']);
  68 + $row->getRelation('user_xi')->visible(['nickname']);
  69 + $row->getRelation('user_zhao')->visible(['nickname']);
70 $row->getRelation('vip')->visible(['title']); 70 $row->getRelation('vip')->visible(['title']);
71 } 71 }
72 $list = collection($list)->toArray(); 72 $list = collection($list)->toArray();