Update ShopOrderItem.php

This commit is contained in:
邹景立 2022-10-18 13:28:06 +08:00
parent c10936ab9e
commit ac664a269d

View File

@ -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',
]);
}
}