This commit is contained in:
Tokumeikoi 2020-03-05 03:32:25 +08:00
parent 3fe442313d
commit 3becb71a5a

View File

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