diff --git a/app/Model/v3/Goods.php b/app/Model/v3/Goods.php index 1e6a60e..452d025 100644 --- a/app/Model/v3/Goods.php +++ b/app/Model/v3/Goods.php @@ -133,19 +133,4 @@ class Goods extends Model return $this->morphMany(ShoppingCart::class, 'goods'); } - public function setSpecAttribute($value) - { - $this->attributes['spec'] = json_encode($value); - } - - public function setTagsAttribute($value) - { - $this->attributes['tags'] = json_encode($value); - } - - public function setDetailsImgsAttribute($value) - { - $this->attributes['details_imgs'] = json_encode($value); - } - } \ No newline at end of file diff --git a/app/Model/v3/GoodsActivity.php b/app/Model/v3/GoodsActivity.php index 497a6da..9e59936 100644 --- a/app/Model/v3/GoodsActivity.php +++ b/app/Model/v3/GoodsActivity.php @@ -100,18 +100,4 @@ class GoodsActivity extends Model return $this->morphMany(ShoppingCart::class, 'goods'); } - public function setSpecAttribute($value) - { - $this->attributes['spec'] = json_encode($value); - } - - public function setTagsAttribute($value) - { - $this->attributes['tags'] = json_encode($value); - } - - public function setDetailsImgsAttribute($value) - { - $this->attributes['details_imgs'] = json_encode($value); - } } \ No newline at end of file diff --git a/app/Model/v3/OrderGoods.php b/app/Model/v3/OrderGoods.php index b1e1035..b8290d0 100644 --- a/app/Model/v3/OrderGoods.php +++ b/app/Model/v3/OrderGoods.php @@ -52,14 +52,4 @@ class OrderGoods extends Model { return Goods::query()->where(['id' => $this->attributes['goods_id']])->value('tags'); } - - public function setSpecAttribute($value) - { - $this->attributes['spec'] = json_encode($value); - } - - public function setTagsAttribute($value) - { - $this->attributes['tags'] = json_encode($value); - } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 7e421e5..cdc2e36 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -207,7 +207,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface 'name' => $goods->name, 'goods_unit' => $goods->goods_unit, 'cover_img' => $goods->cover_img, - 'spec' => $goods->spec, + 'spec' => json_encode($goods->spec), ]; }