diff --git a/app/Constants/v3/ErrorCode.php b/app/Constants/v3/ErrorCode.php index 750b94f..6e4ce80 100644 --- a/app/Constants/v3/ErrorCode.php +++ b/app/Constants/v3/ErrorCode.php @@ -286,7 +286,7 @@ class ErrorCode extends AbstractConstants /** * 商品超过限购数量 - * @Message("同类活动商品超过限购数量") + * @Message("同类活动商品超过限购种数") */ const GOODS_ACTIVITY_RESTRICT_LIMIT = 1155; diff --git a/app/Controller/v3/WithdrawController.php b/app/Controller/v3/WithdrawController.php index 71a7cbc..459b7c5 100644 --- a/app/Controller/v3/WithdrawController.php +++ b/app/Controller/v3/WithdrawController.php @@ -128,7 +128,7 @@ class WithdrawController extends BaseController $userId = $this->request->input('user_id'); $storeId = $this->request->input('store_id'); - if ($money > 1000) { + if ($money > 3000) { $this->log->event(LogLabel::STORE_WITHDRAW_FAIL_LOG, [ 'msg' => '提现失败[1000]', 'params' => json_encode(['money' => $money, 'user_id' => $userId, 'store_id' => $storeId]), diff --git a/app/Service/v3/Implementations/GoodsActivityService.php b/app/Service/v3/Implementations/GoodsActivityService.php index 691b46f..5bcfd2f 100644 --- a/app/Service/v3/Implementations/GoodsActivityService.php +++ b/app/Service/v3/Implementations/GoodsActivityService.php @@ -99,8 +99,12 @@ class GoodsActivityService implements GoodsActivityServiceInterface $expireTime = 0; if ($goods->time_limit_days >= 1) { $expireTime += strtotime(date('Y-m-d 23:59:59')) - time(); + $expireTime += ($goods->time_limit_days-1) * 86400; + } elseif ($goods->time_limit_days > 0 && $goods->time_limit_days < 1) { + $expireTime += bcmul($goods->time_limit_days,86400,0); + } else { + return; } - $expireTime += ($goods->time_limit_days-1) * 86400; $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); @@ -145,17 +149,26 @@ class GoodsActivityService implements GoodsActivityServiceInterface ->get()->toArray(); $limitNums = [ - ActivityType::FLASH_SALE => 1, - ActivityType::GROUP_BUY => 1, - ActivityType::NEW_PRODUCT => 1, + ActivityType::FLASH_SALE => 0, + ActivityType::GROUP_BUY => 0, + ActivityType::NEW_PRODUCT => 0, ]; - $buyNum = 0; + $buyNum = [ + ActivityType::FLASH_SALE => 0, + ActivityType::GROUP_BUY => 0, + ActivityType::NEW_PRODUCT => 0, + ]; foreach ($sourceGoods as $key => &$goods) { - if ($buyNum >= $limitNums[$goods['type']]) { + + if ($limitNums[$goods->type] == 0) { // 不限制同类购买商品种数,也就是可以同时购买多款不同商品 + continue; + } + + $buyNum[$goods->type] += 1; + if ($buyNum[$goods->type] > $limitNums[$goods->type]) { return false; } - $buyNum++; } return true; diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index fbdebf9..57219a8 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -337,7 +337,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface // 判断是否有购买多个特价商品 $check = $this->goodsActivityService->checkOrderActivityCount($activityGoodsIds); if(!$check){ - $this->log->event(LogLabel::ORDER_ONLINE_LOG, ['msg' => '订单中有活动商品超过限购数量', 'data' => json_encode($dataOrderGoods)]); + $this->log->event(LogLabel::ORDER_ONLINE_LOG, ['msg' => '同一订单中有活动商品不可同时购买多款', 'data' => json_encode($dataOrderGoods)]); throw new ErrorCodeException(ErrorCode::GOODS_ACTIVITY_RESTRICT_LIMIT); }