如何在cakephp2中进行查询,使用表单中的动态日期
SELECT centro_id, (sum(timestampdiff(minute, hora_inicio, hora_fin)))/(720*(SELECT datediff(date_format(now(), '%Y-%m-%d'), '2013-07-01')))*100 FROM `sesions` where fecha BETWEEN '2013-07-01' and date_format(now(), '%Y-%m-%d') GROUP BY 1;