From c278870c928457c09147101bab3caafe03ff2bc8 Mon Sep 17 00:00:00 2001 From: marina Date: Thu, 19 Sep 2024 12:29:09 +0300 Subject: [PATCH] =?utf8?q?=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86?= =?utf8?q?=D0=B8=D1=8F=20=D1=81=D0=BC=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../modules/v1/controllers/timetable/PlanController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erp24/api3/modules/v1/controllers/timetable/PlanController.php b/erp24/api3/modules/v1/controllers/timetable/PlanController.php index 4508a23d..b308e583 100644 --- a/erp24/api3/modules/v1/controllers/timetable/PlanController.php +++ b/erp24/api3/modules/v1/controllers/timetable/PlanController.php @@ -37,6 +37,14 @@ class PlanController extends \yii_app\api3\controllers\ActiveController 'searchModel' => $this->modelClass, ]; + $actions['index']['prepareSearchQuery'] = function ($query, $requestParams) { + $plans = TimetableFactModel::find() + ->andWhere(['admin_id' => $requestParams['filter']['admin_id']]) + ->select('plan_id') + ->column(); + return $query->andFilterWhere(['not in', 'id', $plans]); + }; + unset($actions['delete']); return $actions; -- 2.39.5