From 3becb71a5a8b63c0a1aeb189280f693925cca9c2 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Thu, 5 Mar 2020 03:32:25 +0800 Subject: [PATCH] fix --- app/Http/Controllers/Admin/PlanController.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Admin/PlanController.php b/app/Http/Controllers/Admin/PlanController.php index ea4dc974..c717b2a0 100755 --- a/app/Http/Controllers/Admin/PlanController.php +++ b/app/Http/Controllers/Admin/PlanController.php @@ -29,14 +29,12 @@ 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) + ->get() + ->update(['group_id', $plan->group_id]) + ) { + DB::rollBack(); + abort(500, '保存失败'); } if (!$plan->update($params)) { DB::rollBack();