我有点困惑如何转换我的查询:
> 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]:未知列 'Date(date_created)' in 'where cla....