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