From a3c3a8077419e22baf27c5a2e62bedee1c8e17ac Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 22 Oct 2024 12:02:43 +0300 Subject: [PATCH] =?utf8?q?ERP-223=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?utf8?q?=D1=82=D1=8C=20=D0=B2=20/admin-person-bonuses/=20=D1=81=D1=82?= =?utf8?q?=D1=80=D0=BE=D1=87=D0=BA=D1=83=20=D0=9F=D0=B5=D1=80=D0=B5=D1=80?= =?utf8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20(=D1=81=D1=83=D0=BC=D0=BC?= =?utf8?q?=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/ApiController.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/erp24/controllers/ApiController.php b/erp24/controllers/ApiController.php index 66b4c62d..7abeea9a 100644 --- a/erp24/controllers/ApiController.php +++ b/erp24/controllers/ApiController.php @@ -4,6 +4,7 @@ namespace app\controllers; use yii\db\StaleObjectException; use yii_app\records\AdminGroup; +use yii_app\records\EmployeeOnShift; use yii_app\records\StoreGuidBuh; use kartik\select2\Select2; use Yii; @@ -433,6 +434,23 @@ class ApiController extends Controller public function actionStoreGuidBuh() { + $admin = Admin::findOne(1527); + + $model = EmployeeOnShift::findOne(355); + $model->guid = DataHelper::createGuidMy("06"); + $model->created_at = date("Y-m-d H:i:s"); + $model->status = EmployeeOnShift::STATUS_ACCEPT; + $model->status_source = EmployeeOnShift::STATUS_SOURCE_NOT_CREATED_IN_1C; + $model->active = EmployeeOnShift::ACTIVE_ON; + $model->save(); + if ($model->getErrors()) { +var_dump($model->getErrors());die(); + } + + $admin->guid = $model->guid; + $admin->save(false); + + if (!in_array(Admin::findOne([Yii::$app->user->id])->group_id, [AdminGroup::GROUP_IT])) { return $this->render('/site/index'); } -- 2.39.5