samedi 7 mai 2016

Laravel use select inside whereHas

Hi i'm having some truble figuring how to use select inside a wherehas query or i'm i doing in the wrong way ? the query work but it's not selecting.

 $query = $query->whereHas('orderProducts', function($q){

            $q->select(DB::raw('SUM(order_product.total) AS spent_total'));
            $q->select(DB::raw('COUNT(order_product.box_id) as box_count'));

        });

Thanks.



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

Aucun commentaire:

Enregistrer un commentaire