From: Alexander Smirnov Date: Wed, 31 Jul 2024 06:33:02 +0000 (+0000) Subject: [ERP-125] Добавил границы времени для кластерной принадлежности X-Git-Tag: 1.4~56^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=03fd14584a891899441e61029e13901d1362e5ed;p=erp24_rep%2Fyii-erp24%2F.git [ERP-125] Добавил границы времени для кластерной принадлежности --- diff --git a/erp24/api3/core/services/StoreService.php b/erp24/api3/core/services/StoreService.php index af2bfb53..ddc09dc2 100644 --- a/erp24/api3/core/services/StoreService.php +++ b/erp24/api3/core/services/StoreService.php @@ -4,6 +4,7 @@ namespace yii_app\api3\core\services; use yii\db\Exception; use yii\base\InvalidArgumentException; +use yii\db\Expression; use yii_app\helpers\ClientHelper; use yii_app\helpers\SalaryHelper; use yii_app\records\Assemblies; @@ -299,6 +300,8 @@ class StoreService public function getClusters() { $storeDynamic = StoreDynamic::find()->alias('s')->select(['s.store_id as id', 's.value_int as cluster', 'c.name']) ->innerJoin("city_store c", "c.id = s.store_id") + ->where(['<=', 'date_from', new Expression('NOW()::text')]) + ->andWhere(['>=', 'date_to', new Expression('NOW()::text')]) ->asArray()->all(); $storesPerCluster = [];