删除
This commit is contained in:
@@ -13,6 +13,7 @@ use app\service\OssService;
|
|||||||
use plugin\admin\app\common\Util;
|
use plugin\admin\app\common\Util;
|
||||||
use plugin\admin\app\model\Location;
|
use plugin\admin\app\model\Location;
|
||||||
use support\Cache;
|
use support\Cache;
|
||||||
|
use support\Db;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
@@ -625,4 +626,21 @@ class VehicleController extends Crud
|
|||||||
|
|
||||||
return json(['code' => 0, 'msg' => 'success', 'data' => $translations]);
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user