diff --git a/app/adminapi/validate/project/ProjectAttendanceDetailValidate.php b/app/adminapi/validate/project/ProjectAttendanceDetailValidate.php index eed8cdb13..9a1f1bba6 100644 --- a/app/adminapi/validate/project/ProjectAttendanceDetailValidate.php +++ b/app/adminapi/validate/project/ProjectAttendanceDetailValidate.php @@ -139,7 +139,7 @@ class ProjectAttendanceDetailValidate extends BaseValidate public function checkWorkStartTime($value): bool|string { if($value != ''){ - if(date('Y-m-d H:i:s',strtotime($value)) != $value){ + if(date('Y-m-d H:i',strtotime($value)) != $value){ return '上班时间格式错误'; } } @@ -149,7 +149,7 @@ class ProjectAttendanceDetailValidate extends BaseValidate public function checkWorkEndTime($value,$rule,$data): bool|string { if($value != ''){ - if(date('Y-m-d H:i:s',strtotime($value)) != $value){ + if(date('Y-m-d H:i',strtotime($value)) != $value){ return '下班时间格式错误'; } if(strtotime($value) - strtotime($data['work_start_time']) <= 0){ diff --git a/app/adminapi/validate/project/ProjectAttendanceRecordValidate.php b/app/adminapi/validate/project/ProjectAttendanceRecordValidate.php index d4a7e7551..e49add287 100644 --- a/app/adminapi/validate/project/ProjectAttendanceRecordValidate.php +++ b/app/adminapi/validate/project/ProjectAttendanceRecordValidate.php @@ -136,12 +136,12 @@ class ProjectAttendanceRecordValidate extends BaseValidate } } if(isset($v['work_start_time']) && $v['work_start_time'] != ''){ - if(date('Y-m-d H:i:s',strtotime($v['work_start_time'])) != $v['work_start_time']){ + if(date('Y-m-d H:i',strtotime($v['work_start_time'])) != $v['work_start_time']){ return '上班时间格式错误'; } } if(isset($v['work_end_time']) && $v['work_end_time'] != ''){ - if(date('Y-m-d H:i:s',strtotime($v['work_end_time'])) != $v['work_end_time']){ + if(date('Y-m-d H:i',strtotime($v['work_end_time'])) != $v['work_end_time']){ return '下班时间格式错误'; } if(strtotime($v['work_end_time']) - strtotime($v['work_start_time']) < 0){