From c5862ce1e9103523d852f3c1b2248722025a9468 Mon Sep 17 00:00:00 2001 From: hellcat <> Date: Mon, 13 Oct 2025 20:07:50 +0800 Subject: [PATCH] no message --- src/Controllers/User/CouponController.php | 8 ++++---- src/Controllers/User/PlanController.php | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Controllers/User/CouponController.php b/src/Controllers/User/CouponController.php index 9d4be134a..140c11ee9 100755 --- a/src/Controllers/User/CouponController.php +++ b/src/Controllers/User/CouponController.php @@ -74,10 +74,10 @@ final class CouponController extends BaseController $aPayOrderStatus = ["activated", "pending", "expired"]; $user_use_count = (new Order())->where('user_id', $user->id)->where('user_coupon', $coupon->code)->whereIn("status", $aPayOrderStatus)->count(); if ($user_use_count >= $use_limit) { -// return $response->withJson([ -// 'ret' => 0, -// 'msg' => '优惠码使用次数已达上限', -// ]); + return $response->withJson([ + 'ret' => 0, + 'msg' => '优惠码使用次数已达上限', + ]); } } diff --git a/src/Controllers/User/PlanController.php b/src/Controllers/User/PlanController.php index 63fe6600d..5223df89f 100755 --- a/src/Controllers/User/PlanController.php +++ b/src/Controllers/User/PlanController.php @@ -27,13 +27,13 @@ final class PlanController extends BaseController $oOrder = Order::where("user_id", $this->user->id) ->where("product_code", "!=", "code") + ->where("status", "!=", "cancelled") ->orderByRaw("CASE WHEN status = 'payment_pending' THEN 1 WHEN status = 'activated' THEN 2 WHEN status = 'pending' THEN 3 WHEN status = 'expired' THEN 4 - When status = 'cancelled' THEN 5 - ELSE 6 + ELSE 5 END") ->orderBy('id', 'asc') // 按 id 降序排序 ->paginate(20, ['*'], 'page', $iPage); @@ -55,9 +55,8 @@ final class PlanController extends BaseController $oUserPlanRow->status = "提前续订"; } else if ($oUserPlanRow->status == "expired") { $oUserPlanRow->status = "已过期"; - } else if ($oUserPlanRow->status == "cancelled") { - $oUserPlanRow->status = "取消支付"; } + } $sView = $this->view()