'timestamp', 'updated_at' => 'timestamp' ]; protected $hidden = ['password']; // 获取邀请人信息 public function invite_user() { return $this->belongsTo(self::class, 'invite_user_id', 'id'); } // 获取用户套餐 public function plan() { return $this->belongsTo(Plan::class, 'plan_id', 'id'); } public function group() { return $this->belongsTo(ServerGroup::class, 'group_id', 'id'); } // 获取用户邀请码列表 public function codes() { return $this->hasMany(InviteCode::class, 'user_id', 'id'); } // 关联工单列表 public function tickets() { return $this->hasMany(Ticket::class, 'user_id', 'id'); } }