model/drivercar.php
public function user()
{
return $this->belongsTo('User', 'driver_id', 'id', [], 'INNER')->setEagerlyType(0);
}
public function company(){
return $this->belongsTo('Company','user.company_id','id',[], 'LEFT')->setEagerlyType(0);
}
public function team(){
return $this->belongsTo('Team','user.team_id','id',[], 'LEFT')->setEagerlyType(0);
}
controller/drivercar.php
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['user','