From 2c4d42c2f299efecb28c4592248e62d11e4e95a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Sat, 11 Dec 2021 11:53:29 +0800 Subject: [PATCH] Update --- app/Models/User.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index c15d84ad..f7723485 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -94,6 +94,32 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac return $this->hasMany(ShippingAddress::class); } + /** + * 属于此用户的订单 + */ + public function orders() + { + return $this->hasMany(Order::class); + } + + /** + * 属于此用户的商品收藏记录 + */ + public function skuFavorites() + { + return $this->hasMany(ProductSkuFavorite::class); + } + + /** + * 确认此用户是否是 VIP + * + * @return bool + */ + public function isVip(): bool + { + return false; + } + /** * 禁用用户 *