如何添加别名声明?
这是原始代码:
DB::table(DB::raw('manager as a'))
->leftJoin('parameter as p',function($join){
$join->on('a.vipStatus','=','p.code')
})
->where('a.active','=','1');
我像这样转移sql
$this->manager
->leftJoin('parameter as p',function($join){
$join->on('manager.vipStatus','=','p.code')
})
->where('manager.active','=','1');
$this->manager
使用__construct()注入经理表,
如何将manager.vipStatus
更改为a.vipStatus
?