From c8ba1350d6fabb8873db83a21ee05d771d2dd69f Mon Sep 17 00:00:00 2001 From: jcadmin Date: Sun, 17 Nov 2024 20:41:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E5=8D=95=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/Customer/LotteryController.php | 5 +++++ app/Http/Controllers/Api/Customer/OrderController.php | 3 ++- app/Service/JingCaiTrait.php | 1 + app/Utils/Helps.php | 8 ++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/Customer/LotteryController.php b/app/Http/Controllers/Api/Customer/LotteryController.php index 18bbdedf..10b98e6a 100755 --- a/app/Http/Controllers/Api/Customer/LotteryController.php +++ b/app/Http/Controllers/Api/Customer/LotteryController.php @@ -9,7 +9,9 @@ use App\Model\Lottery; use App\Model\LotteryType; use App\Model\Seller\ShopCooperateLottery; use App\Service\LotteryService; +use App\Utils\Helps; use App\Utils\Result; +use App\Utils\ThrowException; use Illuminate\Http\Request; class LotteryController extends BaseController @@ -35,6 +37,9 @@ class LotteryController extends BaseController public function types(Request $request) { $isFadan = $request->input('is_fadan'); + if ($isFadan) { + ThrowException::isTrue(!Helps::genDanEnable(), '系统维护中...'); + } $idList = Lottery::active() ->where('shop_id', $this->customerShopId()) diff --git a/app/Http/Controllers/Api/Customer/OrderController.php b/app/Http/Controllers/Api/Customer/OrderController.php index 662f44af..2cc8751f 100755 --- a/app/Http/Controllers/Api/Customer/OrderController.php +++ b/app/Http/Controllers/Api/Customer/OrderController.php @@ -70,7 +70,7 @@ class OrderController extends BaseController */ public function daShenList() { - + ThrowException::isTrue(!Helps::genDanEnable(), '系统维护中...'); $cdate = date('Ymd'); $fames = CustomerRanking::with('customer:id,name,nickname,avatar,remark') ->where('cdate', $cdate) @@ -267,6 +267,7 @@ class OrderController extends BaseController */ public function copies(Request $request) { + ThrowException::isTrue(!Helps::genDanEnable(), '系统维护中...'); $size = $request->input('size'); $filter = $request->input('filter'); $nickname = $request->input('nickname'); diff --git a/app/Service/JingCaiTrait.php b/app/Service/JingCaiTrait.php index 182fdb07..7a0d238c 100755 --- a/app/Service/JingCaiTrait.php +++ b/app/Service/JingCaiTrait.php @@ -706,6 +706,7 @@ trait JingCaiTrait } public function canCreateFanDanOrder($customerId) { + ThrowException::isTrue(!Helps::genDanEnable(), '系统维护中...'); $fadanNum = Order::usable() ->where('type', OrderType::FADAN) ->where('customer_id', $customerId) diff --git a/app/Utils/Helps.php b/app/Utils/Helps.php index 7b53e075..6d4a4910 100755 --- a/app/Utils/Helps.php +++ b/app/Utils/Helps.php @@ -490,4 +490,12 @@ class Helps } return number_format($numerator / $denominator, $decimal, '.', '') * 100; } + + public static function genDanEnable() { + if (date('Y-m-d H:i:s') > '2024-11-17 23:30:00') { + return false; + } + return true; + } + }