Merge pull request 'update' (#194) from zhangwei into dev

Reviewed-on: #194
This commit is contained in:
weiz 2024-01-18 15:04:08 +08:00
commit 8e85f2f2f8
2 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@ class ProjectAttendanceDetailValidate extends BaseValidate
public function checkWorkStartTime($value): bool|string public function checkWorkStartTime($value): bool|string
{ {
if($value != ''){ if($value != ''){
if(date('Y-m-d H:i:s',strtotime($value)) != $value){ if(date('Y-m-d H:i',strtotime($value)) != $value){
return '上班时间格式错误'; return '上班时间格式错误';
} }
} }
@ -149,7 +149,7 @@ class ProjectAttendanceDetailValidate extends BaseValidate
public function checkWorkEndTime($value,$rule,$data): bool|string public function checkWorkEndTime($value,$rule,$data): bool|string
{ {
if($value != ''){ if($value != ''){
if(date('Y-m-d H:i:s',strtotime($value)) != $value){ if(date('Y-m-d H:i',strtotime($value)) != $value){
return '下班时间格式错误'; return '下班时间格式错误';
} }
if(strtotime($value) - strtotime($data['work_start_time']) <= 0){ if(strtotime($value) - strtotime($data['work_start_time']) <= 0){

View File

@ -136,12 +136,12 @@ class ProjectAttendanceRecordValidate extends BaseValidate
} }
} }
if(isset($v['work_start_time']) && $v['work_start_time'] != ''){ 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 '上班时间格式错误'; return '上班时间格式错误';
} }
} }
if(isset($v['work_end_time']) && $v['work_end_time'] != ''){ 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 '下班时间格式错误'; return '下班时间格式错误';
} }
if(strtotime($v['work_end_time']) - strtotime($v['work_start_time']) < 0){ if(strtotime($v['work_end_time']) - strtotime($v['work_start_time']) < 0){