diff --git a/app/Service/v3/Implementations/GoodsActivityService.php b/app/Service/v3/Implementations/GoodsActivityService.php index 5bcfd2f..72700e6 100644 --- a/app/Service/v3/Implementations/GoodsActivityService.php +++ b/app/Service/v3/Implementations/GoodsActivityService.php @@ -159,14 +159,15 @@ class GoodsActivityService implements GoodsActivityServiceInterface ActivityType::GROUP_BUY => 0, ActivityType::NEW_PRODUCT => 0, ]; + foreach ($sourceGoods as $key => &$goods) { - if ($limitNums[$goods->type] == 0) { // 不限制同类购买商品种数,也就是可以同时购买多款不同商品 + if ($limitNums[$goods['type']] == 0) { // 不限制同类购买商品种数,也就是可以同时购买多款不同商品 continue; } - $buyNum[$goods->type] += 1; - if ($buyNum[$goods->type] > $limitNums[$goods->type]) { + $buyNum[$goods['type']] += 1; + if ($buyNum[$goods['type']] > $limitNums[$goods['type']]) { return false; } }