From 23d70b425d007f80befa06a87e5dc968bdf5b122 Mon Sep 17 00:00:00 2001 From: weigang Date: Wed, 9 Sep 2020 15:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=95=86=E5=93=81=E8=A1=A8sp?= =?UTF-8?q?ec=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/Goods.php | 15 --------------- app/Model/v3/GoodsActivity.php | 14 -------------- app/Model/v3/OrderGoods.php | 10 ---------- .../v3/Implementations/OrderOnlineService.php | 2 +- 4 files changed, 1 insertion(+), 40 deletions(-) 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), ]; }