С
Size: a a a
С
VY
С
D
VY
СД
VY
IG
IG
🎃
VY
return VendorProduct::with(['product' =>формирует такой запрос
function ($query) {
$query->withCount('images')
->where('images_count', '>', 1);
}
])
->get();
select `products`.*,вроде все красиво, но получаю ошибку
(select count(*) from `images`
inner join `product_images` on `images`.`id` = `product_images`.`image_id`
where `products`.`id` = `product_images`.`product_id`)
as `images_count`
from `products`
where `products`.`id` in (1, 2, 3) and `images_count` > 1
D
VY
SS
VY
VY
return VendorProduct::with(['product' =>
function ($query) {
$query->withCount('images')
->having('images_count', '>', 1);
}
])
->has('product')
->get();
Ss