我有 sql 代码,我想用 cake php 做,但我不知道怎么做,我不想那样做
$obj->查询($sql);这是我的查询:
“选择 dbfiles.amount, MONTHNAME(cases.enquiry_date) 作为 Month FROM cases INNER JOIN services ON cases.id = services.case_id INNER JOIN dbfiles ON services.id = dbfiles.service_id WHERE case.status = 2 AND YEAR(cases.enquiry_date) = '2012' AND dbfiles.type = 'INV' AND case.currency = 'EUR' GROUP BY dbfiles.invoice_num ORDER BY Month DESC; "