Kohana 3.0:個別のエントリを取得する方法は?
-
27-10-2019 - |
質問
Kohanaクエリでは、同じIDを持つ1つの要素のみを取得する必要があります。モデルにはメソッドがあります。
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を使用して実行できますか?
どうもありがとう!
解決
それはaを使用して動作しますか group by
?
return $this->where('product_image_product', '>=', $id-5)->limit(5)->group_by('product_image_product')->find_all();
所属していません StackOverflow