dimanche 27 septembre 2015

Laravel Query for MySQL Concat

I have a table like this-

webinars

enter image description here

I want to have a query in Laravel Query Builder like this-

    // Base Quary
    $baseQuery = DB::table('webinars')
        //->join('users', 'panelists.user_id', '=', 'users.id')
        ->select(
            'id',
            'title',
            'description',
            'hosts',
            DB::raw('concat(starts_on, ' ', timezone) as starts'),
            'duration',
            'created_at'
        )
        ->where('user_id', '=', $user_ID);

And getting error for-

     DB::raw('concat(starts_on, ' ', timezone) as starts')

I need it because I want something like =>

today JPN

if starts_on=today and timezone='JPN'

Can anyone pleae help?



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

Aucun commentaire:

Enregistrer un commentaire