标签: laravel laravel-5
任何人都可以解释一下IF(transactions.retail_cost > 0,1,0)从以下查询中的含义吗?
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" );