在Kohana查询中,我只需要检索一个具有相同id的元素。我在模型中有一个方法:
public function next_products_images($id)
{
return $this->where('product_image_product', '>=', $id-5)->limit(5)->find_all();
//for taking the previous five product pictures
} 但问题是,从由该方法生成的所有上述结果中,我只需要具有"product_image_product“截然不同的结果。使用Kohana ORM可以做到这一点吗?
非常感谢!
发布于 2011-09-08 20:18:04
它可以使用group by工作吗
return $this->where('product_image_product', '>=', $id-5)->limit(5)->group_by('product_image_product')->find_all();https://stackoverflow.com/questions/7346119
复制相似问题