diff --git a/app/store/model/Goods.php b/app/store/model/Goods.php index 0321db74..34464c93 100644 --- a/app/store/model/Goods.php +++ b/app/store/model/Goods.php @@ -154,6 +154,7 @@ class Goods extends GoodsModel //如果是编辑多规格商品 if ($data['spec_type'] == GoodsSpecTypeEnum::MULTI) { $data['spu_id'] = $this['goods_id']; + //取消之前所有的商品组商品 } // 更新商品 $this->save($data); diff --git a/app/store/model/GoodsSku.php b/app/store/model/GoodsSku.php index a6e8f46c..1e7b01c6 100644 --- a/app/store/model/GoodsSku.php +++ b/app/store/model/GoodsSku.php @@ -56,6 +56,7 @@ class GoodsSku extends GoodsSkuModel //设置spu_id为当前商品id的商品的spu_id=0; by liuqing GoodsModel::where('spu_id', $goodsId)->update(['spu_id' => 0]); + GoodsSku::where('spu_id', $goodsId)->update(['spu_id' => 0, 'goods_props' => "", 'spec_value_ids' => '']); //更新sku列表里面的商品id的spu_id GoodsModel::whereIn('goods_id', $goodsIds)->update(['spu_id' => $goodsId]);