feat: 1.完善打卡时间
parent
8696374aff
commit
28f102462a
|
@ -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 = [
|
||||
|
|
|
@ -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'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
<label class="layui-form-label required">上午工作时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="am-time" name="am" class="layui-input" value="{$item.am ?? ''}">
|
||||
<div class="layui-form-mid layui-word-aux">
|
||||
工作时间修改后,第二天生效
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -48,6 +51,9 @@
|
|||
<label class="layui-form-label required">下午工作时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="pm-time" name="pm" class="layui-input" value="{$item.pm ?? ''}">
|
||||
<div class="layui-form-mid layui-word-aux">
|
||||
工作时间修改后,第二天生效
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue