修复查询异常

This commit is contained in:
yaooo 2023-09-28 10:38:01 +08:00
parent ad03e71f0f
commit 20b4a49638

View File

@ -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']);