Merge pull request #73 from v2board/dev

Dev
This commit is contained in:
tokumeikoi 2020-03-05 03:35:46 +08:00 committed by GitHub
commit 6dc5dd0edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,14 +29,11 @@ class PlanController extends Controller
abort(500, '该订阅不存在');
}
DB::beginTransaction();
if (isset($params->group_id) && ($params->group_id !== $plan->group_id)) {
if (!User::where('plan_id', $plan->id)
->get()
->update(['group_id', $plan->group_id])
) {
DB::rollBack();
abort(500, '保存失败');
}
if (!User::where('plan_id', $plan->id)
->update(['group_id' => $plan->group_id])
) {
DB::rollBack();
abort(500, '保存失败');
}
if (!$plan->update($params)) {
DB::rollBack();