This commit is contained in:
2025-06-25 15:04:12 +08:00
parent bd597c4248
commit 6c1b98de10
@@ -13,6 +13,7 @@ use app\service\OssService;
use plugin\admin\app\common\Util;
use plugin\admin\app\model\Location;
use support\Cache;
use support\Db;
use support\Log;
use support\Request;
use support\Response;
@@ -625,4 +626,21 @@ class VehicleController extends Crud
return json(['code' => 0, 'msg' => 'success', 'data' => $translations]);
}
public function delete(Request $request): Response
{
$id = $request->input('id');
Db::beginTransaction();
try {
$return = Vehicle::where('id', $id)->delete();
VehicleEn::where('id', $id)->delete();
VehicleRu::where('id', $id)->delete();
VehicleAr::where('id', $id)->delete();
Db::commit();
return $this->json(0);
} catch (\Throwable $th) {
Db::rollBack();
return $this->json(-1, $th->getMessage());
}
}
}