mirror of
https://github.com/v2board/v2board.git
synced 2024-11-13 11:09:11 +08:00
update
This commit is contained in:
parent
deed547188
commit
175372b9cd
@ -14,7 +14,8 @@ use App\Models\User;
|
|||||||
class ServerController extends Controller
|
class ServerController extends Controller
|
||||||
{
|
{
|
||||||
public function index (Request $request) {
|
public function index (Request $request) {
|
||||||
$server = Server::get();
|
$server = Server::orderBy('name')
|
||||||
|
->get();
|
||||||
for ($i = 0; $i < count($server); $i++) {
|
for ($i = 0; $i < count($server); $i++) {
|
||||||
if (!empty($server[$i]['tags'])) {
|
if (!empty($server[$i]['tags'])) {
|
||||||
$server[$i]['tags'] = json_decode($server[$i]['tags']);
|
$server[$i]['tags'] = json_decode($server[$i]['tags']);
|
||||||
|
@ -16,7 +16,9 @@ class ClientController extends Controller
|
|||||||
$user = $request->user;
|
$user = $request->user;
|
||||||
$server = [];
|
$server = [];
|
||||||
if ($user->expired_at > time()) {
|
if ($user->expired_at > time()) {
|
||||||
$servers = Server::where('show', 1)->get();
|
$servers = Server::where('show', 1)
|
||||||
|
->orderBy('name')
|
||||||
|
->get();
|
||||||
foreach ($servers as $item) {
|
foreach ($servers as $item) {
|
||||||
$groupId = json_decode($item['group_id']);
|
$groupId = json_decode($item['group_id']);
|
||||||
if (in_array($user->group_id, $groupId)) {
|
if (in_array($user->group_id, $groupId)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user