This commit is contained in:
weiz 2024-01-24 11:17:29 +08:00
parent fb71d25e96
commit de14dc1438
21 changed files with 44 additions and 65 deletions

@ -124,9 +124,8 @@ class BuildProcessSettingsValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -111,9 +111,8 @@ class ProjectAttendanceRecordValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -41,7 +41,7 @@ class ProjectSettlementValidate extends BaseValidate
'settlement_amount_uppercase' => 'require',
'remaining_amount' => 'require|float|egt:0',
'settlement_date' => 'require|dateFormat:Y-m-d',
'annex' => 'checkFile'
'annex' => 'checkAnnex'
];
protected $message = [
@ -129,11 +129,10 @@ class ProjectSettlementValidate extends BaseValidate
return true;
}
public function checkFile($value): bool|string
public function checkAnnex($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -128,9 +128,8 @@ class QualityAcceptValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -128,9 +128,8 @@ class QualityAccidentValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -117,9 +117,8 @@ class QualityDetectionTempValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -118,9 +118,8 @@ class QualityDetectionValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -129,9 +129,8 @@ class QualityMboValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -117,9 +117,8 @@ class QualitySpecificationValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -128,9 +128,8 @@ class QualitySuperviseValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -144,9 +144,8 @@ class SafetyAccidentValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -127,9 +127,8 @@ class SafetyCheckValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -140,9 +140,8 @@ class SafetyEmergencyPlanValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -143,9 +143,8 @@ class SafetyEvaluateValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -144,9 +144,8 @@ class SafetyEventValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -126,9 +126,8 @@ class SafetyHazardValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -148,9 +148,8 @@ class SafetyProductMonthValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -143,9 +143,8 @@ class SafetyRehearsalValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -134,9 +134,8 @@ class SafetyStandardValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -120,9 +120,8 @@ class SafetySuperviseValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}

@ -143,9 +143,8 @@ class SafetyTargetValidate extends BaseValidate
public function checkFile($value): bool|string
{
if($value != ''){
$file = $value;//json_decode($value,true);
if(empty($file)){
if(!empty($value) && $value != ''){
if(!is_array($value)){
return '附件必须是json数组';
}
}