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