This commit is contained in:
root 2019-12-15 21:53:07 +08:00
parent deed547188
commit 175372b9cd
2 changed files with 5 additions and 2 deletions

View File

@ -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']);

View File

@ -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)) {