|
|
|
@ -267,6 +267,15 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// TODO 校验当前用户今天是否超过了购买活动秒杀商品的(特定价格)的订单笔数
|
|
|
|
if (!$this->checkIfBuyFlashGoodsToday($userId)) { |
|
|
|
throw new ErrorCodeException( |
|
|
|
ErrorCode::ORDER_ONLINE_LIMIT_BUY_COUNT, |
|
|
|
'['.env('LIMIT_BUY_COUNT').']', |
|
|
|
['params' => $userId, 'limit_prices' => env('LIMIT_BUY_COUNT_GOODS_PRICES')] |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
$check = $this->goodsActivityService->check($goods, $cart->num, $userId); |
|
|
|
if (true !== $check) { |
|
|
|
throw new ErrorCodeException($check, '['.$goods->name.']'); |
|
|
|
@ -821,7 +830,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
$goodsTable = ApplicationContext::getContainer()->get(OrderGoods::class)->getTable(); |
|
|
|
|
|
|
|
$limitPrices = explode(',', env('LIMIT_BUY_COUNT_GOODS_PRICES')); |
|
|
|
$limitCount = env('LIMIT_BUY_COUNT'); |
|
|
|
$limitCount = intval(env('LIMIT_BUY_COUNT')); |
|
|
|
|
|
|
|
$countToday = OrderMain::query() |
|
|
|
->join($orderTable, $orderTable.'.order_main_id', '=', $mainTable.'.global_order_id') |
|
|
|
|