From: JoySystem_v Date: Tue, 27 Aug 2024 07:13:23 +0000 (+0300) Subject: возвратил добавление задним числом - месяцы раннее текущего X-Git-Tag: 1.5~20^2~9 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=93d4f36dd3b13dcf07b2fa77f466e8644f5eb3be;p=erp24_rep%2Fyii-erp24%2F.git возвратил добавление задним числом - месяцы раннее текущего --- diff --git a/erp24/controllers/crud/EmployeePaymentController.php b/erp24/controllers/crud/EmployeePaymentController.php index e886b565..c234b29c 100755 --- a/erp24/controllers/crud/EmployeePaymentController.php +++ b/erp24/controllers/crud/EmployeePaymentController.php @@ -95,7 +95,8 @@ class EmployeePaymentController extends Controller */ public function actionCreate($admin_id = null) { - $model = new EmployeePayment(['scenario' => 'create']); + // $model = new EmployeePayment(['scenario' => 'create']); + $model = new EmployeePayment(); // Если передан admin_id, устанавливаем его в модели if ($admin_id !== null) { @@ -126,7 +127,7 @@ class EmployeePaymentController extends Controller public function actionUpdate($id) { $model = $this->findModel($id); - $model->scenario = 'update'; + // $model->scenario = 'update'; $admin = Yii::$app->user->identity; // Проверка на group_id и дату записи diff --git a/erp24/records/EmployeePayment.php b/erp24/records/EmployeePayment.php index cee4ede3..23a38f42 100755 --- a/erp24/records/EmployeePayment.php +++ b/erp24/records/EmployeePayment.php @@ -45,7 +45,7 @@ class EmployeePayment extends \yii\db\ActiveRecord [['creator_id'], 'exist', 'skipOnError' => true, 'targetClass' => Admin::class, 'targetAttribute' => ['creator_id' => 'id']], [['daily_payment'], 'validateDailyPayment'], [['date', 'admin_id'], 'validateUniqueDate'], - ['date', 'validateDateForCreate', 'on' => 'create'], +// ['date', 'validateDateForCreate', 'on' => 'create'], ]; }