mercredi 25 mai 2016

'whereNotNull' not working, still returns all records (null,not null)

First here's my code for retrieving records from a model

$employees = employee::where('employee_id','ACTIVE')
            ->where('employee_id','!=','')
            ->whereNotNull('employee_id')
            ->whereNotNull('branch')
            ->where('branch','!=','')
            ->whereNotNull('department')
            ->where('department','!=','')
            ->get();

As you can see on my query, I supposed to get all the records where 'employee_id' is active, not null, not empty and where 'branch' is active, not null, not empty and where 'department' is active, not null, not empty but it gives me all the records either its active, not null, null, not active, empty and not empty. Any help, ideas, clues, suggestions, recommendations please?



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

Aucun commentaire:

Enregistrer un commentaire