fix(商品): 编辑商品不再覆盖真实销量

This commit is contained in:
From-wh 2026-10-23 15:01:22 +08:00 committed by 吴昊天
parent 0ae6971cbd
commit a23eadfb09
2 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,8 @@ class ProductSaveServices extends BaseService
$productId = $this->transaction(function () use ($id, $data, $centerData) {
if ($id > 0) {
// 编辑不覆盖真实销量:sales 由支付成功累加、退款递减,保存表单不收集该字段,固定 0 更新会把销量清零
unset($centerData['sales']);
$this->centerProductServices->update($id, $centerData);
$productId = $id;
} else {

View File

@ -56,6 +56,8 @@ class ProductSaveServices extends BaseService
$productId = $this->transaction(function () use ($id, $data, $centerData) {
if ($id > 0) {
// 编辑不覆盖真实销量:sales 由支付成功累加、退款递减,保存表单不收集该字段,固定 0 更新会把销量清零
unset($centerData['sales']);
$this->centerProductServices->update($id, $centerData);
$productId = $id;
} else {