mardi 2 mai 2017

Query Buider Laravel 5

Can somebody help me, This My database sql query My Table

`SELECT supplier,
MAX(IF(item_name = 'Lemon', price, NULL)) AS Lemon,
MAX(IF(item_name = 'Apple', price, NULL)) AS Apple,
MAX(IF(item_name = 'Durian', price, NULL)) AS Durian,
MAX(IF(item_name = 'Mango', price, NULL)) AS Mango
FROM offer
where status = 'open'
GROUP BY supplier`

how use this query by Laravel QueryBuilder ? Thank's...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire