兼容修改时的id

This commit is contained in:
2025-05-22 17:08:42 +08:00
parent 9405c96677
commit 5c37dd24d5
+4 -3
View File
@@ -278,6 +278,7 @@ class VehicleNewService extends BaseService
throw new BusinessException('提交失败:常见问题'); throw new BusinessException('提交失败:常见问题');
} }
} else { } else {
unset($asked['id']);
$asked_res = $VehicleNewAskedService->create($asked); $asked_res = $VehicleNewAskedService->create($asked);
if (!$asked_res) { if (!$asked_res) {
throw new BusinessException('提交失败:常见问题'); throw new BusinessException('提交失败:常见问题');
@@ -306,6 +307,7 @@ class VehicleNewService extends BaseService
throw new BusinessException('提交失败:车辆特性'); throw new BusinessException('提交失败:车辆特性');
} }
} else { } else {
unset($trait['id']);
$trait_res = $VehicleNewAskedService->create($trait); $trait_res = $VehicleNewAskedService->create($trait);
if (!$trait_res) { if (!$trait_res) {
throw new BusinessException('提交失败:车辆特性'); throw new BusinessException('提交失败:车辆特性');
@@ -332,8 +334,6 @@ class VehicleNewService extends BaseService
// } // }
$albumsId = []; $albumsId = [];
// var_dump(!empty($album['id']));
$album['vehicle_id'] = 78;
if(!empty($album['id'])){ if(!empty($album['id'])){
$albumId =$album['id']; $albumId =$album['id'];
$albumsId[] =$albumId; $albumsId[] =$albumId;
@@ -342,6 +342,7 @@ class VehicleNewService extends BaseService
throw new BusinessException('提交失败:车辆图册'); throw new BusinessException('提交失败:车辆图册');
} }
} else { } else {
unset($album['id']);
$album_res = $VehicleNewAlbumService->create($album); $album_res = $VehicleNewAlbumService->create($album);
if (!$album_res) { if (!$album_res) {
throw new BusinessException('提交失败:车辆图册1'); throw new BusinessException('提交失败:车辆图册1');
@@ -371,12 +372,12 @@ class VehicleNewService extends BaseService
if(!empty($content['id'])){ if(!empty($content['id'])){
$contentId =$content['id']; $contentId =$content['id'];
$contentsId[] =$contentId; $contentsId[] =$contentId;
$content['vehicle_id'] = 78;
$content_res = $VehicleNewContentService->update($contentId,$content); $content_res = $VehicleNewContentService->update($contentId,$content);
if (!$content_res) { if (!$content_res) {
throw new BusinessException('提交失败:车辆介绍1'); throw new BusinessException('提交失败:车辆介绍1');
} }
} else { } else {
unset($content['id']);
$content_res = $VehicleNewAskedService->create($content); $content_res = $VehicleNewAskedService->create($content);
if (!$content_res) { if (!$content_res) {
throw new BusinessException('提交失败:车辆介绍'); throw new BusinessException('提交失败:车辆介绍');