From: Aleksey Filippov Date: Fri, 6 Mar 2026 22:52:31 +0000 (+0300) Subject: fix(TO8-22): is_promo_balance boolean validation in Promocode model X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e31925a574175254338232975c1dd036e3aaf162;p=erp24_rep%2Fyii-erp24%2F.git fix(TO8-22): is_promo_balance boolean validation in Promocode model Колонка is_promo_balance в PostgreSQL — boolean, а валидатор был integer. PDO возвращает PHP false → IntegerValidator падает: "должно быть целым числом". --- diff --git a/erp24/records/Promocode.php b/erp24/records/Promocode.php index 995b7670..35b37fb1 100644 --- a/erp24/records/Promocode.php +++ b/erp24/records/Promocode.php @@ -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'],