fix: 修复多处可能出现的事务安全问题

This commit is contained in:
xboard committed 2023-12-14 13:07:57 +08:00
1 parent 1c3879e292
commit 4973a390ef
4 files changed
+4 -1

No files matched your search

@@ -49,12 +49,12 @@ class PlanController extends Controller
}
$plan->update($params);
DB::commit();
return $this->success(true);
} catch (\Exception $e) {
DB::rollBack();
\Log::error($e);
return $this->fail([500 ,'保存失败']);
}
return $this->success(true);
}
if (!Plan::create($params)) {
return $this->fail([500 ,'创建失败']);