mardi 20 juillet 2021

query laravel 5.6 whereNull condition, return empty array

I´m traying to create a query with whereNull() condition but, return this result:

Illuminate\Support\Collection Object
(
    [items:protected] => Array
        (
        )

)

in my db table i have data whith empty column data:

i need create my query with DB::table() and my query is:

$result = \DB::table('listado')
                                        ->join('llamada AS ll','ll.id_listado','=','listado.id')
                                        ->join('users AS tele','ll.id_teleoperadora','=','tele.id')
                                        ->join('llamada_estado AS estado','ll.id_estado', '=', 'estado.id')
                                        ->join('cita AS c', 'c.id_llamada', 'll.id')
                                        ->join('cita_estado AS ct', 'c.id_estado', 'ct.id')
                                        ->where('listado.cp', '=', $cp)
                                        ->whereNull('listado.id_teleoperadora')
                                        ->select(
                                            'listado.id as listId','listado.nomape as listNom','listado.direccion as listDirec',
                                            'listado.provincia as listPro', 'listado.ciudad as listCiu', /*'tele.nombre as teleNombre',*/ 'estado.nombre as estaNombre',
                                            'ct.nombre as ctNombre', 'll.created_at as llaCreated'
                                        )
                                        ->get();

in my table listado i have column id_teleoperadora and if one call don´t have operator assign this column it´s null.

And i need fill datatable with operator null...

Thanks for read, and for help me



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3xYBunW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire