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; + } + /** * 禁用用户 *