fixed
This commit is contained in:
@@ -215,8 +215,21 @@ class Firm extends Backend
|
||||
}catch(ValidateException|PDOException|Exception $e){
|
||||
return json(['code'=>201,'msg'=>$e->getMessage()]);
|
||||
}
|
||||
if (!$firmbigcategoryResult || !$firmcustomerorigiResult || !$firmdutyResult || !$firmtagsResult){
|
||||
return json(['code'=>201,'msg'=>'导入失败']);
|
||||
|
||||
$requiredResults = [
|
||||
'firmbigcategoryResult' => $firmbigcategoryResult ?? null,
|
||||
'firmcustomerorigiResult' => $firmcustomerorigiResult ?? null,
|
||||
'firmdutyResult' => $firmdutyResult ?? null,
|
||||
'firmtagsResult' => $firmtagsResult ?? null,
|
||||
];
|
||||
foreach ($requiredResults as $key => $value) {
|
||||
if (!$value) {
|
||||
// 返回更详细的错误信息,指出具体哪个变量导致失败
|
||||
return json([
|
||||
'code' => 201,
|
||||
'msg' => "导入失败:{$key} 为空或无效"
|
||||
]);
|
||||
}
|
||||
}
|
||||
return json(['code'=>200,'msg'=>'导入成功']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user