You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do $products = ProductEav::select(['attr.*'])->paginate(20);
And I have error
SQLSTATE[42803]: Grouping error: 7 ERROR: column "rating_attr.value" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...d" and "rating_attr"."attribute_id" = $1 order by "rating_at... ^ (SQL: select count(*) as aggregate from "products" inner join "product_float" as "rating_attr" on "products"."id" = "rating_attr"."entity_id" and "rating_attr"."attribute_id" = 122 order by "rating_attr"."value" desc)
Hi again @sunel.
Problem pagination
$products = ProductEav::select(['attr.*'])/*->groupBy('rating_attr.value', 'products.id')*/->paginate(20);
solved by adding to the request
groupBy('rating_attr.value', 'products.id')
The text was updated successfully, but these errors were encountered: