增加发单开关

pull/1/head
jcadmin 2024-11-17 20:41:05 +08:00
parent 07753ec10d
commit c8ba1350d6
4 changed files with 16 additions and 1 deletions

View File

@ -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())

View File

@ -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');

View File

@ -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)

View File

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