]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
fix(TO8-22): is_promo_balance boolean validation in Promocode model feature_fomichev_2026-03-06_TO8-22_promobonuses origin/feature_fomichev_2026-03-06_TO8-22_promobonuses
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Fri, 6 Mar 2026 22:52:31 +0000 (01:52 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Fri, 6 Mar 2026 22:52:31 +0000 (01:52 +0300)
Колонка is_promo_balance в PostgreSQL — boolean, а валидатор был integer.
PDO возвращает PHP false → IntegerValidator падает: "должно быть целым числом".

erp24/records/Promocode.php

index 995b7670a7ce72009d2977caeacc3d6c2e4ca485..35b37fb152b868f8394c898c16990f3ae2480541 100644 (file)
@@ -49,7 +49,8 @@ class Promocode extends \yii\db\ActiveRecord
         return [
             [['code', 'bonus', 'duration', 'active', 'date_start', 'date_end', 'created_by', 'created_at'], 'required'],
             [['code'], 'string', 'max' => 20],
-            [['bonus', 'duration', 'active', 'used', 'base', 'parent_id', 'created_by', 'updated_by', 'is_promo_balance'], 'integer'],
+            [['bonus', 'duration', 'active', 'used', 'base', 'parent_id', 'created_by', 'updated_by'], 'integer'],
+            [['is_promo_balance'], 'boolean'],
             [['date_start', 'date_end', 'created_at', 'updated_at'], 'datetime', 'format' => 'php:Y-m-d H:i:s'],
             [['activated_by'], 'integer'],
             [['activated_at'], 'datetime', 'format' => 'php:Y-m-d H:i:s'],