Commit e4b7691d authored by 张晓林's avatar 张晓林

证照批量上传优化

parent e02a486d
...@@ -170,6 +170,7 @@ class BranchLicenceController extends BaseController{ ...@@ -170,6 +170,7 @@ class BranchLicenceController extends BaseController{
$licenceInfo->LICENCE_IMG_URL = $licenceValues[4]; $licenceInfo->LICENCE_IMG_URL = $licenceValues[4];
$licenceInfo->LICENCE_EXPIRY_DATE = $licenceValues[5]; $licenceInfo->LICENCE_EXPIRY_DATE = $licenceValues[5];
$licenceInfo->IS_SHOW = $licenceValues[7]; $licenceInfo->IS_SHOW = $licenceValues[7];
unset($data[$key]);
if(!$licenceInfo->save()){ if(!$licenceInfo->save()){
$transaction->rollBack(); $transaction->rollBack();
unlink($file); unlink($file);
...@@ -178,9 +179,7 @@ class BranchLicenceController extends BaseController{ ...@@ -178,9 +179,7 @@ class BranchLicenceController extends BaseController{
]; ];
throw new HttpException("422", json_encode($returnInfo)); throw new HttpException("422", json_encode($returnInfo));
} }
$transaction->commit();
unlink($file);
throw new HttpException("200", '导入成功');
}else{ }else{
$transaction->rollBack(); $transaction->rollBack();
unlink($file); unlink($file);
...@@ -190,8 +189,10 @@ class BranchLicenceController extends BaseController{ ...@@ -190,8 +189,10 @@ class BranchLicenceController extends BaseController{
]; ];
} }
} }
$transaction->commit();
unlink($file);
throw new HttpException("200", '导入成功');
}else{ }else{
$transaction->rollBack();
throw new HttpException(422); throw new HttpException(422);
} }
}else{ }else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment