|
|
@@ -43,6 +43,11 @@ class User extends Authenticatable implements JWTSubject
|
|
|
return $telegram->identifier ?? null;
|
|
|
}
|
|
|
|
|
|
+ public function userAuths(): HasMany
|
|
|
+ {
|
|
|
+ return $this->hasMany(UserOauth::class);
|
|
|
+ }
|
|
|
+
|
|
|
public function profile()
|
|
|
{
|
|
|
return [
|
|
|
@@ -70,11 +75,6 @@ class User extends Authenticatable implements JWTSubject
|
|
|
];
|
|
|
}
|
|
|
|
|
|
- public function userAuths(): HasMany
|
|
|
- {
|
|
|
- return $this->hasMany(UserOauth::class);
|
|
|
- }
|
|
|
-
|
|
|
public function onlineIpLogs(): HasMany
|
|
|
{
|
|
|
return $this->hasMany(NodeOnlineIp::class);
|
|
|
@@ -264,7 +264,7 @@ class User extends Authenticatable implements JWTSubject
|
|
|
}
|
|
|
|
|
|
public function incrementData(int $data): bool
|
|
|
- {// 添加用户流量
|
|
|
+ { // 添加用户流量
|
|
|
$this->transfer_enable += $data;
|
|
|
|
|
|
return $this->save();
|
|
|
@@ -272,7 +272,6 @@ class User extends Authenticatable implements JWTSubject
|
|
|
|
|
|
public function isNotCompleteOrderByUserId(int $userId): bool
|
|
|
{ // 添加用户余额
|
|
|
-
|
|
|
return Order::uid($userId)->whereIn('status', [0, 1])->exists();
|
|
|
}
|
|
|
|
|
|
@@ -299,7 +298,7 @@ class User extends Authenticatable implements JWTSubject
|
|
|
}
|
|
|
|
|
|
public function isTrafficWarning(): bool
|
|
|
- {// 流量异常警告
|
|
|
+ { // 流量异常警告
|
|
|
return $this->recentTrafficUsed() >= (sysConfig('traffic_ban_value') * GB);
|
|
|
}
|
|
|
|