jeudi 14 septembre 2017

Laravel groupBy not work

I want to make one group by depend on my custom condition.But I am not sure my way is right or not.

My code

$cderList = $cderListQuery->groupBy('cder_id')
    ->groupBy('name')
    ->groupBy(function ($query) {
        if(!is_null($this->hp) || !is_null($this->hp))
        {
            $query->groupBy('Value_Float');
        }

     })
    ->orderBy('introduced', 'DESC')
    ->limit(20)
    ->get();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire