This commit is contained in:
weiz 2024-01-18 15:03:29 +08:00
parent a405995ebf
commit 3ec8efedb9
2 changed files with 4 additions and 4 deletions

@ -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){

@ -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){