From ac664a269dda9544be579d868a67b56e94b4a665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 18 Oct 2022 13:28:06 +0800 Subject: [PATCH] Update ShopOrderItem.php --- app/data/model/ShopOrderItem.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/data/model/ShopOrderItem.php b/app/data/model/ShopOrderItem.php index 38571b088..5e04c21e5 100644 --- a/app/data/model/ShopOrderItem.php +++ b/app/data/model/ShopOrderItem.php @@ -20,4 +20,16 @@ class ShopOrderItem extends Model { return $this->hasOne(ShopGoods::class, 'code', 'goods_code'); } + + /** + * 绑定商品数据 + * @return void + */ + public function bindGoods() + { + $this->goods()->bind([ + 'goods_name' => 'name', + 'goods_cover' => 'cover', + ]); + } } \ No newline at end of file