diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index 8997b038..9e572b08 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -196,8 +196,10 @@ class SpuRepository extends BaseRepository // 最多10条随机数据 if ($randNum > 10) { array_rand($randPidList, 10); - } else { + } else if ($randNum == 0) { array_rand($randPidList, $randNum); + } else { + $randPidList = []; } $where['product_id'] = $randPidList; unset($where['mer_rand_id'], $where['page']);