优化随机查询云仓商品
This commit is contained in:
parent
6e9fb8d3f7
commit
aa6f8fd6c6
@ -240,7 +240,7 @@ class SpuRepository extends BaseRepository
|
||||
if ($remainCount == 0) {
|
||||
$productIds = $RedisCacheService->sRandMember($dataKey, 10);
|
||||
} else {
|
||||
for ($i = 0; $i < $remainCount; $i++) {
|
||||
for ($i = 0; $i < min($remainCount, 10); $i++) {
|
||||
$productIds[] = $RedisCacheService->sPop($remainKey);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user