diff --git a/app/Models/UserPurchase.php b/app/Models/UserPurchase.php index f46b4d7..7c0e6ed 100644 --- a/app/Models/UserPurchase.php +++ b/app/Models/UserPurchase.php @@ -32,6 +32,14 @@ class UserPurchase extends Model return $this->belongsTo(User::class); } + /** + * 购买记录对应的商品(shopItem 别名,兼容婚姻系统调用) + */ + public function item(): BelongsTo + { + return $this->belongsTo(ShopItem::class, 'shop_item_id'); + } + /** * 购买记录对应的商品 */