下单抽奖领取商品奖品之后还能继续抽奖问题处理
一 文件地址:app/services/order/StoreOrderSuccessServices.php
方法:paySuccess
修改代码:
//缓存抽奖次数 除过线下支付和抽奖订单
if (isset($orderInfo['pay_type']) && $orderInfo['pay_type'] != 'offline' && isset($orderInfo['type']) && $orderInfo['type'] != 8) {
/** @var LuckLotteryServices $luckLotteryServices */
$luckLotteryServices = app()->make(LuckLotteryServices::class);
$luckLotteryServices->setCacheLotteryNum((int)$orderInfo['uid'], 'order');
}
Copy
如下图
二 文件地址:app/controller/api/v2/activity/LuckLottery.php
方法:LotteryInfo
修改代码:
if ($factor == 3 && $lotteryData['lottery_num'] < 1) {
return app('json')->successful('ok', []);
}
如下图: