From b5aa1d27b426f252ed0ae701617490bff35dcaf7 Mon Sep 17 00:00:00 2001 From: Marina Zozirova Date: Tue, 17 Sep 2024 14:08:19 +0000 Subject: [PATCH] =?utf8?q?ERP-175=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?utf8?q?=D0=B8=D1=82=D1=8C=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?utf8?q?=D0=B2=D0=BE=D1=80=D0=BA-=D0=B1=D0=BE=D1=82=D0=B0=20=D0=9E=D0=A2?= =?utf8?q?=D0=9A=D0=90=D0=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../controllers/timetable/PlanController.php | 4 +- erp24/records/TimetableFactModel.php | 45 ------------------- 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/erp24/api3/modules/v1/controllers/timetable/PlanController.php b/erp24/api3/modules/v1/controllers/timetable/PlanController.php index 51e920a4..617d8c31 100644 --- a/erp24/api3/modules/v1/controllers/timetable/PlanController.php +++ b/erp24/api3/modules/v1/controllers/timetable/PlanController.php @@ -19,8 +19,8 @@ class PlanController extends \yii_app\api3\controllers\ActiveController { use ServiceTrait; -// public $modelClass = \yii_app\api3\modules\v1\models\timetable\Timetable::class; - public $modelClass = TimetableFactModel::class; + public $modelClass = \yii_app\api3\modules\v1\models\timetable\Timetable::class; +// public $modelClass = TimetableFactModel::class; public function actions() diff --git a/erp24/records/TimetableFactModel.php b/erp24/records/TimetableFactModel.php index fb95f1d5..0fc5a007 100644 --- a/erp24/records/TimetableFactModel.php +++ b/erp24/records/TimetableFactModel.php @@ -191,51 +191,6 @@ class TimetableFactModel extends ActiveRecord ->one(); } - public function fields() - { - $fields = [ - 'id', - 'admin_id', - 'store_id', - 'shift_id', - 'salary_shift', - // 'price' => fn($x) => $x->shift_id == 2 ? 140 : 125, - 'tabel', - 'date_shift', - 'date_start' => fn($x) => $x->date_start . ' ' .$x->time_start, - 'date_end' => fn($x) => !empty($x->date_end) ? $x->date_end . ' ' .$x->time_end : null, - 'time_start', - 'time_end', - 'work_time', - 'status', - 'checkInCount', - 'can_open' => fn($x) => $this->is_opening === false && $this->is_close === true, - ]; - - return $fields; - } - - public function extraFields() - { - return [ - 'admin' => fn($x) => [ - 'id' => $x->admin->id, - 'name' => $x->admin->name, - 'guid' => $x->admin->guid, - 'group' => [ - 'id' => $x->admin->group_id, - 'name' => $x->admin->group_name, - ], - ], - 'store' => fn($x) => [ - 'id' => $x->store->id, - 'name' => $x->store->name, - 'name_full' => $x->store->name_full, - ], - 'checkIns' - ]; - } - public function getCheckIns() { return $this->hasMany(AdminCheckin::class, ['admin_id' => 'admin_id']) -- 2.39.5