From fdd1a6abf12bc0acc1399bf053e0ce7b0c7eaa38 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 9 Oct 2024 14:58:57 +0300 Subject: [PATCH] =?utf8?q?=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D0=BC=20sal?= =?utf8?q?ary=5Fshift=20=D0=B8=D0=B7=20=D0=B7=D0=B0=D1=8F=D0=B2=D0=BA?= =?utf8?q?=D0=B8=20=D0=B4=D0=BB=D1=8F=201=D1=81=20=D0=B8=20=D0=B8=D0=B7?= =?utf8?q?=D0=BC=D0=B5=D0=BD=D1=8F=D0=B5=D0=BC=20Employee=5Fon=5Fshift=20r?= =?utf8?q?ules?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/EmployeeOnShift.php | 4 ++-- ...22_create_employee_for_1c_with_admins_with_empty_guid.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erp24/records/EmployeeOnShift.php b/erp24/records/EmployeeOnShift.php index 0be14777..1155474d 100644 --- a/erp24/records/EmployeeOnShift.php +++ b/erp24/records/EmployeeOnShift.php @@ -53,9 +53,9 @@ class EmployeeOnShift extends \yii\db\ActiveRecord // Сделать проверку этой таблички телефона return [ [['guid', 'phone', 'created_at', 'shift_date', 'shift_type', 'datetime_start', 'datetime_end', 'created_by', 'store_id', 'price'], 'required'], - [['created_at', 'shift_date', 'datetime_start', 'datetime_end'], 'safe'], + [['created_at', 'shift_date', 'datetime_start', 'datetime_end', 'salary_shift'], 'safe'], [['shift_type', 'created_by', 'price', 'status', 'status_source', 'active'], 'integer'], - [['salary_shift'], 'in', 'range' => Timetable::getSalariesDay(), 'skipOnEmpty' => false], + [['salary_shift'], 'in', 'range' => Timetable::getSalariesDay(), 'skipOnEmpty' => true], [['guid', 'store_id'], 'string', 'max' => 36], [['phone'], 'string', 'max' => 16], [['first_name', 'last_name'], 'string', 'max' => 40], diff --git a/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php b/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php index 2bc3e4c2..2b125e51 100644 --- a/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php +++ b/erp24/scripts/tasks/task_22_create_employee_for_1c_with_admins_with_empty_guid.php @@ -98,7 +98,7 @@ try { } } - $salaryShift = Timetable::getFirstValueSalariesDay(); +// $salaryShift = Timetable::getFirstValueSalariesDay(); $model = new EmployeeOnShift([ 'first_name' => $admin->name, 'last_name' => '', 'phone' => $admin->phone, @@ -108,7 +108,7 @@ try { 'created_by' => 1, 'store_id' => $storeGuid, 'price' => 0, - 'salary_shift' => $salaryShift, +// 'salary_shift' => $salaryShift, ]); $model->guid = DataHelper::createGuidMy("06"); $model->created_at = date("Y-m-d H:i:s"); @@ -118,6 +118,7 @@ try { $model->save(); if ($model->getErrors()) { $error .= json_encode($model->getErrors(), JSON_UNESCAPED_UNICODE); + continue; } $admin->guid = $model->guid; -- 2.39.5