需要Laravel查询说明

时间:2017-11-29 11:55:57

标签: laravel laravel-5

任何人都可以解释一下IF(transactions.retail_cost > 0,1,0)从以下查询中的含义吗?

$query = Distributors::selectRaw(
    "distributors.name,distributors.group_id,"
    . "distributors.pay,"
    . "SUM(IF(transactions.retail_cost > 0,1,0)) AS trans_number"
); 

0 个答案:

没有答案