lezhenkin писал(а):
Попробуйте перед первым своим вызовом метода where() добавить clearWhere()
Добавил, по итогу другой товар вывелся, но все равно один
$fieldName = count($Shop_Controller_Show->getFilterProperties()) || count($Shop_Controller_Show->getFilterPrices()) || $Shop_Controller_Show->producer
? $Shop_Controller_Show->getFilterTableName() . '.shop_item_id'
: 'shop_items.id';
$cur_oShop = $Shop_Controller_Show->getEntity();
$cur_oShopItems = $cur_oShop->Shop_Items;
$cur_oShopItems->queryBuilder()
->join('shop_warehouse_items', 'shop_warehouse_items.shop_item_id', '=', $fieldName)
->join('shop_warehouses', 'shop_warehouses.id', '=', 'shop_warehouse_items.shop_warehouse_id')
->clearWhere()
->where('shop_warehouses.active', '=', 1)
->having('SUM(shop_warehouse_items.count)', '>', 0)
->where('shop_items.shop_group_id', '=', $cur_group_cat)
->where('shop_items.id', '!=', $cur_item_cat)
->where('shop_items.modification_id', '=', 0)
->where('shop_items.shortcut_id', '=', 0)
->where('shop_items.active', '=', 1)
->where('shop_items.price', '>', 0)
->clearSelect()
->select('shop_items.*')
->limit(30)
;
lezhenkin писал(а):
У вас в итоговом запросе у оператора WHERE два условия для поля `deleted`
Как это может повлиять? Убрал, код что ниже, ничего не изменилось
->where('shop_items.deleted', '!=', 1)
hostcms писал(а):
Пожалуйста, помогите решить проблему