This commit is contained in:
mkm 2024-01-13 17:51:24 +08:00
parent 72cd3e5054
commit 9fda964fc5
2 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ class CustomContactsLogic extends BaseLogic
'telephone' => $params['telephone'] ?? '', 'telephone' => $params['telephone'] ?? '',
'email' => $params['email'] ?? '', 'email' => $params['email'] ?? '',
'notes' => $params['notes'] ?? '', 'notes' => $params['notes'] ?? '',
'annex' => $params['annex'] ?? null, 'annex' => $params['annex'] ?json_encode($params['annex']):'',
]); ]);
Db::commit(); Db::commit();
return true; return true;

View File

@ -107,11 +107,11 @@ class CustomContactsValidate extends BaseValidate
public function checkAnnex($value): bool|string public function checkAnnex($value): bool|string
{ {
if(!empty($value) && $value != ''){ if(!empty($value) && !is_array($value)){
$annex = json_decode($value,true); // $annex = json_decode($value,true);
if(empty($annex) || !is_array($annex)){ // if(empty($annex) || !is_array($annex)){
return '附件数据格式错误'; return '附件数据格式错误';
} // }
} }
return true; return true;
} }