Browse Source

fix: expired buy reset issue

Tokumeikoi 4 years ago
parent
commit
ebec80a75c
1 changed files with 2 additions and 5 deletions
  1. 2 5
      app/Http/Controllers/User/OrderController.php

+ 2 - 5
app/Http/Controllers/User/OrderController.php

@@ -87,15 +87,12 @@ class OrderController extends Controller
         }
 
         if ($plan[$request->input('cycle')] === NULL) {
-            if ($request->input('cycle') === 'reset_price') {
-                abort(500, '该订阅当前不支持重置流量');
-            }
             abort(500, '该订阅周期无法进行购买,请选择其他周期');
         }
 
         if ($request->input('cycle') === 'reset_price') {
-            if (($user->expired_at <= time() || $user->expired_at !== NULL) && !$user->plan_id) {
-                abort(500, '当前无法购买流量重置包');
+            if ($user->expired_at <= time() || !$user->plan_id) {
+                abort(500, '订阅已过期或无有效订阅,无法购买重置包');
             }
         }