优化随机查询云仓商品
This commit is contained in:
parent
a36a775db4
commit
b6b5708be2
@ -224,9 +224,10 @@ class SpuRepository extends BaseRepository
|
||||
{
|
||||
$dataKey = 'CloudMerchantSpu_' . $merId;
|
||||
$takenKey = 'CloudMerchantSpuTakenProductIds_' . $merId . '_page_'. $page;
|
||||
/** @var RedisCacheService $RedisCacheService */
|
||||
$RedisCacheService = app()->make(RedisCacheService::class);
|
||||
if ($RedisCacheService->exists($takenKey)) {
|
||||
return $RedisCacheService->get($dataKey);
|
||||
return $RedisCacheService->sMembers($takenKey);
|
||||
}
|
||||
$keys = $RedisCacheService->sDiff($dataKey, $takenKey);
|
||||
$number = min(count($keys), 10);
|
||||
|
Loading…
x
Reference in New Issue
Block a user