fastadmin关联查询
首先在方法开始处开启关联查询
$this->relationSearch = true; //开启关联查询
然后在模型里面添加方法
public function adminInfo(){
     return $this->belongsTo('Admin', 'uid', 'id', [], 'LEFT')->setEagerlyType(0);
}
最后修改查询方法添加with
$list = $this->model->with('adminInfo')
                ->where($where)
                ->order($sort, $order)
                ->limit($offset, $limit)
                ->select();
    php开发交流群: 901326020

                
            
        
浙公网安备 33010602011771号