diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index 56b9a5a3..a0990a30 100755 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -14,7 +14,8 @@ use App\Models\User; class ServerController extends Controller { public function index (Request $request) { - $server = Server::get(); + $server = Server::orderBy('name') + ->get(); for ($i = 0; $i < count($server); $i++) { if (!empty($server[$i]['tags'])) { $server[$i]['tags'] = json_decode($server[$i]['tags']); diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 2e27281c..dc2a0c06 100755 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -16,7 +16,9 @@ class ClientController extends Controller $user = $request->user; $server = []; if ($user->expired_at > time()) { - $servers = Server::where('show', 1)->get(); + $servers = Server::where('show', 1) + ->orderBy('name') + ->get(); foreach ($servers as $item) { $groupId = json_decode($item['group_id']); if (in_array($user->group_id, $groupId)) {