->from(['s' => 'sales'])
->innerJoin(['sp' => 'sales_products'], 's.id = sp.check_id')
//->andWhere(['s.store_id' => $storeIds])
+ ->innerJoin(['p1c' => 'products_1c_nomenclature'], 'p1c.id = sp.product_id')
->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])
->column();
- var_dump($productIds);
+ var_dump($productIds); die();
if (empty($productIds)) {
Yii::$app->session->setFlash('info', 'Нет товаров, удовлетворяющих условиям.');
return $this->render('add-activity', [