Laravelでのleft joinの使用

428 ワード

Laravelでのleft joinの使用
left joinの使用
        $v = '28';
        $data = DB::table('admin_users AS au')
            ->leftJoin('company AS c','au.company','=','c.id')
            ->where('admin_users.id',$v)
            ->select('au.id','au.name_cn','au.name_en','c.company_name')
            ->first();