From 36f48e6e2498d8d51227da9457e993867c6aa50d Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Fri, 11 Sep 2020 15:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/Goods.php | 4 ++++ app/Model/v3/GoodsActivity.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/app/Model/v3/Goods.php b/app/Model/v3/Goods.php index c0718cb..e872542 100644 --- a/app/Model/v3/Goods.php +++ b/app/Model/v3/Goods.php @@ -134,4 +134,8 @@ class Goods extends Model return $this->morphMany(ShoppingCart::class, 'goods'); } + public function getNameAttribute() + { + return $this->attributes['name'].' '.$this->attributes['goods_unit']; + } } \ No newline at end of file diff --git a/app/Model/v3/GoodsActivity.php b/app/Model/v3/GoodsActivity.php index e6b6887..705a4c6 100644 --- a/app/Model/v3/GoodsActivity.php +++ b/app/Model/v3/GoodsActivity.php @@ -111,4 +111,9 @@ class GoodsActivity extends Model return $img_host . $item; }); } + + public function getNameAttribute() + { + return $this->attributes['name'].' '.$this->attributes['goods_unit']; + } } \ No newline at end of file