diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 7f52b967..dda43ccb 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -1597,6 +1597,18 @@ class ProductRepository extends BaseRepository throw new ValidateException('ID:'.$product->product_id . ' 商品正在参与助力活动'); } $this->dao->updates($id,[$field => $status]); + if ($product->product_type==0){ + $RedisCacheService = app()->make(RedisCacheService::class); + if ($status==1){ + foreach ($id as $k=>$v){ + $RedisCacheService->SADD ('CloudMerchanSpu'.$product['mer_id'], $v); + } + }else{ + foreach ($id as $k=>$v){ + $RedisCacheService->SREM ('CloudMerchanSpu'.$product['mer_id'], $v); + } + } + } Queue::push(ChangeSpuStatusJob::class,['id' => $id,'product_type'=> $product_type]); }