From: Alexander Smirnov Date: Fri, 3 May 2024 10:13:47 +0000 (+0300) Subject: fix X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=5d121f11c2a4d85570b4ca6326f3e33090e6655e;p=yii-erp24%2F.git fix --- diff --git a/erp24/api3/core/services/NotifiableService.php b/erp24/api3/core/services/NotifiableService.php index b865fdf..fea1ff7 100644 --- a/erp24/api3/core/services/NotifiableService.php +++ b/erp24/api3/core/services/NotifiableService.php @@ -33,7 +33,7 @@ class NotifiableService } } - $userBonuses = UsersBonus::find()->select(['phone', 'sum(if(tip=\'plus\', bonus, -bonus)) as sum']) + $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()')])