mirror of
https://github.com/v2board/v2board.git
synced 2025-01-31 02:29:14 +08:00
update
This commit is contained in:
parent
f67d2fb201
commit
53a92569f5
@ -21,7 +21,7 @@ class PlanController extends Controller
|
||||
if ($request->input('id')) {
|
||||
$plan = Plan::find($request->input('id'));
|
||||
if (!$plan) {
|
||||
abort(500, '套餐不存在');
|
||||
abort(500, '该订阅不存在');
|
||||
}
|
||||
} else {
|
||||
$plan = new Plan();
|
||||
@ -66,7 +66,7 @@ class PlanController extends Controller
|
||||
public function show (Request $request) {
|
||||
$plan = Plan::find($request->input('id'));
|
||||
if (!$plan) {
|
||||
abort(500, '套餐不存在');
|
||||
abort(500, '该订阅不存在');
|
||||
}
|
||||
$plan->show = $plan->show ? 0 : 1;
|
||||
if (!$plan->save()) {
|
||||
@ -76,4 +76,18 @@ class PlanController extends Controller
|
||||
'data' => true
|
||||
]);
|
||||
}
|
||||
|
||||
public function renew (Request $request) {
|
||||
$plan = Plan::find($request->input('id'));
|
||||
if (!$plan) {
|
||||
abort(500, '该订阅不存在');
|
||||
}
|
||||
$plan->renew = $plan->renew ? 0 : 1;
|
||||
if (!$plan->save()) {
|
||||
abort(500, '更改失败');
|
||||
}
|
||||
return response([
|
||||
'data' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user