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; + } + }