$data=Db::view('logistics_order',true)
//用户表
->view('logistics_companyuser',['id','name','tel'],'logistics_companyuser.id=logistics_order.companyuser_id','LEFT')
//员工表
->view('logistics_user',['name'=>'username'],'logistics_user.id=logistics_order.user_id','LEFT')
//网点表(发货)
->view('logistics_branch',['name'=>'staer_branch_name'],'logistics_branch.id=logistics_order.staer_branch_id','LEFT')
//门店表(发货)
->view('logistics_store',['name'=>'staer_store_name'],'logistics_store.id=logistics_order.staer_store_id','LEFT')
//网点表(收货)
->view('logistics_branch',['name'=>'receive_branch_name'],'logistics_branch.id=logistics_order.receive_branch_id','LEFT')
//门店表(收货)
->view('logistics_store',['name'=>'receive_store_name'],'logistics_store.id=logistics_order.receive_store_id','LEFT')
->where($map)
->select();
最佳答案
