...
|
...
|
@@ -43,36 +43,31 @@ class Renwu extends Backend |
|
|
$this->relationSearch = true;
|
|
|
//设置过滤方法
|
|
|
$this->request->filter(['strip_tags', 'trim']);
|
|
|
if ($this->request->isAjax()) {
|
|
|
if ($this->request->isAjax())
|
|
|
{
|
|
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
|
|
if ($this->request->request('keyField')) {
|
|
|
if ($this->request->request('keyField'))
|
|
|
{
|
|
|
return $this->selectpage();
|
|
|
}
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
$total = $this->model
|
|
|
->alias('a')
|
|
|
->with(['user', 'vip'])
|
|
|
->with(['user','vip'])
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->join('user u', 'u.id= a.xi_id')
|
|
|
->join('user b', 'b.id= a.zhao_id')
|
|
|
->count();
|
|
|
|
|
|
$list = $this->model
|
|
|
->with(['user', 'vip'])
|
|
|
->with(['user','vip'])
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->limit($offset, $limit)
|
|
|
->join('user u', 'u.id= a.xi_id')
|
|
|
->join('user b', 'b.id= a.zhao_id')
|
|
|
->select();
|
|
|
|
|
|
foreach ($list as $row) {
|
|
|
|
|
|
$row->getRelation('user')->visible(['nickname', 'mobile', 'address', 'address_con', 'car_num', 'color', 'car_type', 'vip']);
|
|
|
$row->getRelation('user')->visible(['nickname','mobile','address','address_con','car_num','color','car_type','vip']);
|
|
|
$row->getRelation('vip')->visible(['title']);
|
|
|
$row->getRelation('xi_id')->visible(['nickname']);
|
|
|
$row->getRelation('zhao_id')->visible(['nickname']);
|
|
|
}
|
|
|
$list = collection($list)->toArray();
|
|
|
$result = array("total" => $total, "rows" => $list);
|
...
|
...
|
|