0

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?

Fan
  • 1,124
  • 3
  • 17
  • 35
  • Give this example a look if you haven't already. http://stackoverflow.com/a/31624248/1133306 – Jared Eitnier Aug 11 '16 at 14:44
  • Possible duplicate of [How to alias a table in Laravel Eloquent queries (or using Query Builder)?](http://stackoverflow.com/questions/17713730/how-to-alias-a-table-in-laravel-eloquent-queries-or-using-query-builder) – Jose Rojas Aug 11 '16 at 14:48

0 Answers0