jeudi 30 mars 2017

Distinct is not working?

  $data = Districts::distinct()->whereRaw('LOWER(district) like ?', [strtolower('%'.$district . '%')])->orWhereRaw('LOWER(region) like ?', [strtolower('%'.$district . '%')])->select('region', 'district')->get();

I have this query, but problem is that distinct not working. I get for example three records for same thing. Any suggestion?



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

Aucun commentaire:

Enregistrer un commentaire