->select('sp.product_id')
->from(['s' => 'sales'])
->innerJoin(['sp' => 'sales_products'], 's.id = sp.check_id')
- ->andWhere(['s.store_id' => $storeIds])
+ //->andWhere(['s.store_id' => $storeIds])
->andWhere(['between', 's.date', "{$startDate} 00:00:00", "{$endDate} 23:59:59"])
->groupBy('sp.product_id')
- ->having(['=', new \yii\db\Expression('COUNT(DISTINCT s.store_id)'), $countStores])
+ //->having(['=', new \yii\db\Expression('COUNT(DISTINCT s.store_id)'), $countStores])
->column();
if (empty($productIds)) {