diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index ee1f7a11..ee13c430 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -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); }); } diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index 4b91fda5..45c55c6b 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -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('编辑成功'); }