批量上架redis
This commit is contained in:
parent
8e1532f17d
commit
c242e5d721
@ -1597,6 +1597,18 @@ class ProductRepository extends BaseRepository
|
|||||||
throw new ValidateException('ID:'.$product->product_id . ' 商品正在参与助力活动');
|
throw new ValidateException('ID:'.$product->product_id . ' 商品正在参与助力活动');
|
||||||
}
|
}
|
||||||
$this->dao->updates($id,[$field => $status]);
|
$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]);
|
Queue::push(ChangeSpuStatusJob::class,['id' => $id,'product_type'=> $product_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user