我不知道如何将这个sql查询转换成yii CDB标准。请给予我一个想法来做。
$sql="SELECT ICode,name,Date ,COUNT(*) AS tot, COUNT(case progress when '1' then 1 else null end) AS complete
FROM invoice i LEFT JOIN `customer` c ON `i`.`CID` = `c`.`CID`
left outer join (SELECT * FROM invoiceitem ) ii on ii.IID = i.IID
GROUP by ICode , name , `Date`
order by complete DESC";
未定义属性“CDbCriteria.0”。
1条答案
按热度按时间lymnna711#
你可以这样写: