This commit is contained in:
weiz 2024-01-23 18:35:02 +08:00
parent e623573382
commit c05c691fa2

View File

@ -46,7 +46,7 @@ class ProjectLaborContractValidate extends BaseValidate
'trial_start_date' => 'dateFormat:Y-m-d', 'trial_start_date' => 'dateFormat:Y-m-d',
'trial_end_date' => 'dateFormat:Y-m-d', 'trial_end_date' => 'dateFormat:Y-m-d',
'release_time' => 'dateFormat:Y-m-d', 'release_time' => 'dateFormat:Y-m-d',
'annex' => 'checkFile', 'annex' => 'checkAnnex',
]; ];
protected $message = [ protected $message = [
@ -160,11 +160,10 @@ class ProjectLaborContractValidate extends BaseValidate
return true; return true;
} }
public function checkFile($value): bool|string public function checkAnnex($value): bool|string
{ {
if($value != ''){ if(!empty($value) && $value != ''){
$file = $value;//json_decode($value,true); if(!is_array($value)){
if(empty($file)){
return '附件必须是json数组'; return '附件必须是json数组';
} }
} }