This commit is contained in:
Tokumeikoi
2020-03-05 16:19:32 +08:00
parent e97f6c64a0
commit c3898ec795
4 changed files with 6 additions and 9 deletions

View File

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