【发布时间】:2012-04-30 07:54:14
【问题描述】:
我有点困惑如何转换我的查询:
> SELECT COUNT(`id`) AS `total_logs`, `userlog`.* FROM `user_log` AS
> `userlog` WHERE `user_id` = '31' AND date(`date_created`) =
> '2012-04-30'
到 Kohana 3.1 ORM?目前我正在使用:
> $isLoged = ORM::factory('Userlog')->select(array('COUNT("id")',
> 'total_logs'))
> ->where('user_id', '=', $user->id)
> ->and_where('Date(date_created)', '=', date('Y-m-d'))
> ->find_all();
不幸的是,上面的一个给出了错误:(
Database_Exception [1054]:未知列“日期(日期创建)”在 '在哪里......
【问题讨论】:
标签: mysql kohana kohana-3 kohana-orm