mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 19:40:53 +08:00
Revert "fix: resolve PHPStan static analysis warnings"
This reverts commit 2d3e4b4a95.
This commit is contained in:
@@ -4,17 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
/**
|
||||
* App\Models\ServerGroup
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name 分组名
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
* @property-read int $server_count 服务器数量
|
||||
*/
|
||||
class ServerGroup extends Model
|
||||
{
|
||||
protected $table = 'v2_server_group';
|
||||
@@ -33,14 +23,4 @@ class ServerGroup extends Model
|
||||
{
|
||||
return Server::whereJsonContains('group_ids', (string) $this->id)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器数量
|
||||
*/
|
||||
protected function serverCount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => Server::whereJsonContains('group_ids', (string) $this->id)->count(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user