From: Alexander Smirnov Date: Thu, 30 May 2024 14:17:35 +0000 (+0300) Subject: fix X-Git-Tag: 1.1~10^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e87ebf7a454c5e12150a718f13b8c7caa573be1d;p=erp24_rep%2Fyii-erp24%2F.git fix --- diff --git a/erp24/api3/core/services/NotifiableService.php b/erp24/api3/core/services/NotifiableService.php index fea1ff74..d2457025 100644 --- a/erp24/api3/core/services/NotifiableService.php +++ b/erp24/api3/core/services/NotifiableService.php @@ -36,7 +36,7 @@ class NotifiableService $userBonuses = UsersBonus::find()->select(['phone', 'sum(CASE WHEN tip=\'plus\' THEN bonus ELSE -bonus END) as sum']) ->where(['in', 'phone', array_keys($buffer)]) ->andWhere(['<', 'date_start', new Expression('NOW()')]) - ->andWhere(['>', 'date_end', new Expression('NOW()')]) + ->andWhere(['or', ['>', 'date_end', new Expression('NOW()')], ['tip' => 'minus']]) ->groupBy(['phone'])->all(); $buffer2 = ArrayHelper::map($userBonuses, 'phone', 'sum');