From 28f102462ac341f19b9742c4ebe8bdd768b8fbc5 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Thu, 12 Jan 2023 16:06:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=201.=E5=AE=8C=E5=96=84=E6=89=93=E5=8D=A1?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/v1/User.php | 5 ++--- app/model/Account.php | 2 +- app/model/Worksite.php | 20 ++++++++------------ view/manager/worksite/edit.html | 6 ++++++ 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/controller/api/v1/User.php b/app/controller/api/v1/User.php index f256d9d..51315c9 100644 --- a/app/controller/api/v1/User.php +++ b/app/controller/api/v1/User.php @@ -585,9 +585,8 @@ class User extends Base } // 是否在打卡时间 - $worktime = Worksite::worktime($input['worksite_id']); - switch ($input['type']) { -// case ClockLog:: + if (!Worksite::checkSignTime($input['worksite_id'], $input['type'])) { + return $this->json(4002, '不在打卡时间段!'); } $data = [ diff --git a/app/model/Account.php b/app/model/Account.php index 28bbeff..744fe48 100644 --- a/app/model/Account.php +++ b/app/model/Account.php @@ -86,7 +86,7 @@ class Account extends Base { return [ 'real_name', 'mobile', 'position', 'pay', 'emergency_contact', 'emergency_phone', 'bank_card_name', 'bank_card_number', - 'bank_name', 'card_number', 'bank_card_img', 'id_front', 'id_back', 'certificate', 'work_experience' + 'bank_name', 'card_number', 'bank_card_img', 'id_front', 'id_back' ]; } } diff --git a/app/model/Worksite.php b/app/model/Worksite.php index 7676133..a6f36ed 100644 --- a/app/model/Worksite.php +++ b/app/model/Worksite.php @@ -93,18 +93,18 @@ class Worksite extends Base if (!$item = self::find($worksiteId)) { return false; } - $morningBegin = $item['old_morning_begin']; - $morningEnd = $item['old_morning_end']; - $afternoonBegin = $item['old_afternoon_begin']; - $afternoonEnd = $item['old_afternoon_end']; + $morningBegin = $item['old_morning_on']; + $morningEnd = $item['old_morning_off']; + $afternoonBegin = $item['old_afternoon_on']; + $afternoonEnd = $item['old_afternoon_off']; $now = time(); if ($now > $item['start_at']) { - $morningBegin = $item['morning_begin']; - $morningEnd = $item['morning_end']; - $afternoonBegin = $item['afternoon_begin']; - $afternoonEnd = $item['afternoon_end']; + $morningBegin = $item['morning_on']; + $morningEnd = $item['morning_off']; + $afternoonBegin = $item['afternoon_on']; + $afternoonEnd = $item['afternoon_off']; } // 时间戳 @@ -115,10 +115,6 @@ class Worksite extends Base $result = false; switch ($type) { - // 普通用户打卡 不限制时间 - case ClockLog::TYPE_NORMAL: - $result = true; - break; // 上午上班时间 打卡时间在上班前的10分钟 case ClockLog::TYPE_MORNING_ON: if (($morningBeginTs - 10 * 60) <= $now && $now <= $morningBeginTs) { diff --git a/view/manager/worksite/edit.html b/view/manager/worksite/edit.html index 58431f0..6346dc2 100644 --- a/view/manager/worksite/edit.html +++ b/view/manager/worksite/edit.html @@ -41,6 +41,9 @@