samedi 26 septembre 2015

Laravel Query Builder - Complex select column error

I have 2 table like this-

panelists

enter image description here

users

enter image description here

I have a Laravel 5.1 query builder like this-

    $baseQuery = DB::table('panelists')
        ->join('users', 'panelists.user_id', '=', 'users.id')
        ->select(
            'users.id',
            'users.name',
            'users.email',
            'IF(enabled=1,"English Book","Other Language")   AS status'
        )
        ->where('panelists.customer_id', '=', $user_ID);

But it is giving me error for

          'IF(enabled=1,"English Book","Other Language")   AS status'

Can anyone help please?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1PGNpKe
via IFTTT

Aucun commentaire:

Enregistrer un commentaire