【发布时间】:2011-01-11 11:56:36
【问题描述】:
我已经建立这个网站几个月了,我刚刚开始使用 Kohana 3。我只想将此 K2.4 查询构建器转换为 K3 查询构建器。
return DB::select(array('posts.id', 'posts.created', 'posts.uri', 'posts.price', 'posts.description', 'posts.title',
'image_count' => db::expr('COUNT(images.id)')))
->from('posts')
->join('images')->on('images.post_id', '=', 'posts.id')
->group_by(array('posts.id'))
->order_by('posts.id', 'DESC')
->limit($limit)
->offset($offset)
->execute();
【问题讨论】: