修复:移动端商品编辑提交后 商品购买协议强制被修改为一个视为有内容的“空”

This commit is contained in:
wuhui_zzw 2024-04-21 17:39:56 +08:00
parent 83dc234e26
commit cda5ce12cd
1 changed files with 2 additions and 1 deletions

View File

@ -296,7 +296,7 @@ class ProductRepository extends BaseRepository
$buyAgreement = [ $buyAgreement = [
'content' => $conType ? json_encode($data['buy_agreement']) : $data['buy_agreement'] , 'content' => $conType ? json_encode($data['buy_agreement']) : $data['buy_agreement'] ,
'type' => 11 'type' => $conType == 0 ? 11 : 12,
]; ];
$spuData['price'] = $settleParams['data']['price']; $spuData['price'] = $settleParams['data']['price'];
$spuData['mer_id'] = $merId; $spuData['mer_id'] = $merId;
@ -389,6 +389,7 @@ class ProductRepository extends BaseRepository
$productAttrValueRepository->add($item,$res->type); $productAttrValueRepository->add($item,$res->type);
} }
} }
if ($content){ if ($content){
app()->make(ProductContentRepository::class)->clearAttr($res->product_id,$content['type']); app()->make(ProductContentRepository::class)->clearAttr($res->product_id,$content['type']);
$this->dao->createContent($res->product_id, $content); $this->dao->createContent($res->product_id, $content);