diff --git a/application/admin/controller/oa/CustomSchedule.php b/application/admin/controller/oa/CustomSchedule.php index 556896c..2965bee 100644 --- a/application/admin/controller/oa/CustomSchedule.php +++ b/application/admin/controller/oa/CustomSchedule.php @@ -83,7 +83,7 @@ class CustomSchedule extends Backend } foreach ($adminIds as $adminId) { - $res[$adminId][$tmpDate] = '无'; + $res[$adminId][$tmpDate] = ''; $res[$adminId]['admin_id'] = $adminId; $res[$adminId]['name'] = $adminNames[$adminId]; $res[$adminId]['editable'] = $this->auth->check('oa/custom_schedule/edit') ? 1 : 0; @@ -117,7 +117,7 @@ class CustomSchedule extends Backend $type = $queryDatum['type']; if (isset($res[$adminId][$date])) { - $res[$adminId][$date] = $this->model->getTypeList()[$type]; + $res[$adminId][$date] = $type; } } @@ -271,21 +271,14 @@ class CustomSchedule extends Backend $date = $params['field']; $adminId = $params['admin_id']; - $value = $params[$date] ?? '无'; - $valueMap = [ - '无' => 0, - '早班' => 1, - '中班' => 2, - '晚班' => 3, - '行政班' => 4, - ]; + $value = $params[$date] ?? ''; - if ($value == '无') { + if (empty($value)) { $this->model->where('exec_admin_id', $adminId)->delete(); $this->success(); } - $dbValue = $valueMap[$value]; + $dbValue = $value; $data = $this->model ->where('date', '=', $date) diff --git a/application/admin/view/oa/custom_schedule/index.html b/application/admin/view/oa/custom_schedule/index.html index ded855f..f002e77 100644 --- a/application/admin/view/oa/custom_schedule/index.html +++ b/application/admin/view/oa/custom_schedule/index.html @@ -7,7 +7,7 @@