From: vladfo Date: Tue, 17 Sep 2024 05:57:14 +0000 (+0300) Subject: Поменял правило валидации X-Git-Tag: 1.5~20^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f9a0dbf53477ac9390e004893bdd77da1894230a;p=erp24_rep%2Fyii-erp24%2F.git Поменял правило валидации --- diff --git a/erp24/records/EmployeePayment.php b/erp24/records/EmployeePayment.php index 23a38f42..b519b3cc 100755 --- a/erp24/records/EmployeePayment.php +++ b/erp24/records/EmployeePayment.php @@ -39,13 +39,13 @@ class EmployeePayment extends \yii\db\ActiveRecord [['admin_id', 'monthly_salary', 'daily_payment'], 'required'], [['admin_id', 'admin_group_id', 'creator_id'], 'integer'], [['date'], 'date', 'format' => 'php:Y-m-d'], - [['monthly_salary', 'daily_payment'], 'number', 'min' => 0.01, 'tooSmall'=>'Значение {attribute} должно быть больше нуля.'], + [['monthly_salary', 'daily_payment'], 'compare', 'compareValue' => 0, 'operator' => '>', 'type' => 'number', 'message' => 'Значение {attribute} должно быть больше нуля.'], [['admin_group_id'], 'exist', 'skipOnError' => true, 'targetClass' => AdminGroup::class, 'targetAttribute' => ['admin_group_id' => 'id']], [['admin_id'], 'exist', 'skipOnError' => true, 'targetClass' => Admin::class, 'targetAttribute' => ['admin_id' => 'id']], [['creator_id'], 'exist', 'skipOnError' => true, 'targetClass' => Admin::class, 'targetAttribute' => ['creator_id' => 'id']], [['daily_payment'], 'validateDailyPayment'], [['date', 'admin_id'], 'validateUniqueDate'], -// ['date', 'validateDateForCreate', 'on' => 'create'], + ]; }