调整商品上架事件

This commit is contained in:
luofei 2023-05-23 15:51:30 +08:00
parent ea733f9fb8
commit 6b54927d33
2 changed files with 3 additions and 3 deletions

View File

@ -284,6 +284,9 @@ class ProductRepository extends BaseRepository
}
app()->make(SpuRepository::class)->baseUpdate($spuData, $id, 0, $productType);
event('product.update',compact('id'));
if ($data['status'] == 0) {
event('product.sell', ['source_mer_id' => $merId, 'product_id' => $id, 'status' => $data['status']]);
}
app()->make(SpuRepository::class)->changeStatus($id, $productType);
});
}

View File

@ -120,9 +120,6 @@ class StoreProduct extends BaseController
$data['mer_status'] = ($merchant['is_del'] || !$merchant['mer_state'] || !$merchant['status']) ? 0 : 1;
$data['mer_id'] = $merId;
$this->repository->edit($id, $data, $merId, 0, 1);
if ($data['status'] == 0) {
event('product.sell', ['source_mer_id' => $merId, 'product_id' => $id, 'status' => $data['status']]);
}
return app('json')->success('编辑成功');
}