How to add alias statement?
Here is the original code :
DB::table(DB::raw('manager as a'))
->leftJoin('parameter as p',function($join){
$join->on('a.vipStatus','=','p.code')
})
->where('a.active','=','1');
and I transfer sql like this
$this->manager
->leftJoin('parameter as p',function($join){
$join->on('manager.vipStatus','=','p.code')
})
->where('manager.active','=','1');
$this->manager
use __construct() inject a manager table ,
How to change manager.vipStatus
to a.vipStatus
?