lundi 18 avril 2016

Transform simple mysql query to laravel 5.1 eloquent builder

Please any one may help me to make this query in laravel5.1:

SELECT sum(orders.price) - (select sum(orders.price) 
    FROM orders INNER JOIN articles ON articles.id = orders.article_id 
    WHERE articles.forSale = false)
FROM orders INNER JOIN articles ON articles.id = orders.article_id 
     e articles.forSale=true



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire