From: Marina Zozirova Date: Tue, 17 Sep 2024 14:08:19 +0000 (+0000) Subject: ERP-175 Исправить ошибки ворк-бота ОТКАТ X-Git-Tag: 1.5~21^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b5aa1d27b426f252ed0ae701617490bff35dcaf7;p=erp24_rep%2Fyii-erp24%2F.git ERP-175 Исправить ошибки ворк-бота ОТКАТ --- 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'])