feat: 1.完善打卡时间
							parent
							
								
									8696374aff
								
							
						
					
					
						commit
						28f102462a
					
				|  | @ -585,9 +585,8 @@ class User extends Base | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // 是否在打卡时间
 |             // 是否在打卡时间
 | ||||||
|             $worktime = Worksite::worktime($input['worksite_id']); |             if (!Worksite::checkSignTime($input['worksite_id'], $input['type'])) { | ||||||
|             switch ($input['type']) { |                 return $this->json(4002, '不在打卡时间段!'); | ||||||
| //                case ClockLog::
 |  | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             $data = [ |             $data = [ | ||||||
|  |  | ||||||
|  | @ -86,7 +86,7 @@ class Account extends Base | ||||||
|     { |     { | ||||||
|         return [ |         return [ | ||||||
|             'real_name', 'mobile', 'position', 'pay', 'emergency_contact', 'emergency_phone', 'bank_card_name', 'bank_card_number', |             '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)) { |         if (!$item = self::find($worksiteId)) { | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|         $morningBegin   = $item['old_morning_begin']; |         $morningBegin   = $item['old_morning_on']; | ||||||
|         $morningEnd     = $item['old_morning_end']; |         $morningEnd     = $item['old_morning_off']; | ||||||
|         $afternoonBegin = $item['old_afternoon_begin']; |         $afternoonBegin = $item['old_afternoon_on']; | ||||||
|         $afternoonEnd   = $item['old_afternoon_end']; |         $afternoonEnd   = $item['old_afternoon_off']; | ||||||
| 
 | 
 | ||||||
|         $now = time(); |         $now = time(); | ||||||
| 
 | 
 | ||||||
|         if ($now > $item['start_at']) { |         if ($now > $item['start_at']) { | ||||||
|             $morningBegin   = $item['morning_begin']; |             $morningBegin   = $item['morning_on']; | ||||||
|             $morningEnd     = $item['morning_end']; |             $morningEnd     = $item['morning_off']; | ||||||
|             $afternoonBegin = $item['afternoon_begin']; |             $afternoonBegin = $item['afternoon_on']; | ||||||
|             $afternoonEnd   = $item['afternoon_end']; |             $afternoonEnd   = $item['afternoon_off']; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // 时间戳
 |         // 时间戳
 | ||||||
|  | @ -115,10 +115,6 @@ class Worksite extends Base | ||||||
| 
 | 
 | ||||||
|         $result = false; |         $result = false; | ||||||
|         switch ($type) { |         switch ($type) { | ||||||
|             // 普通用户打卡  不限制时间
 |  | ||||||
|             case ClockLog::TYPE_NORMAL: |  | ||||||
|                 $result = true; |  | ||||||
|                 break; |  | ||||||
|             // 上午上班时间 打卡时间在上班前的10分钟
 |             // 上午上班时间 打卡时间在上班前的10分钟
 | ||||||
|             case ClockLog::TYPE_MORNING_ON: |             case ClockLog::TYPE_MORNING_ON: | ||||||
|                 if (($morningBeginTs - 10 * 60) <= $now && $now <= $morningBeginTs) { |                 if (($morningBeginTs - 10 * 60) <= $now && $now <= $morningBeginTs) { | ||||||
|  |  | ||||||
|  | @ -41,6 +41,9 @@ | ||||||
|                 <label class="layui-form-label required">上午工作时间</label> |                 <label class="layui-form-label required">上午工作时间</label> | ||||||
|                 <div class="layui-input-block"> |                 <div class="layui-input-block"> | ||||||
|                     <input type="text" id="am-time" name="am" class="layui-input" value="{$item.am ?? ''}"> |                     <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> | ||||||
|             </div> |             </div> | ||||||
| 
 | 
 | ||||||
|  | @ -48,6 +51,9 @@ | ||||||
|                 <label class="layui-form-label required">下午工作时间</label> |                 <label class="layui-form-label required">下午工作时间</label> | ||||||
|                 <div class="layui-input-block"> |                 <div class="layui-input-block"> | ||||||
|                     <input type="text" id="pm-time" name="pm" class="layui-input" value="{$item.pm ?? ''}"> |                     <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> | ||||||
|             </div> |             </div> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue