Lae/resources/views/admin/users/index.blade.php

96 lines
3.4 KiB
PHP
Raw Permalink Normal View History

2022-11-16 01:52:53 +00:00
@extends('layouts.admin')
@section('title', '用户')
@section('content')
2022-11-21 04:55:44 +00:00
{{-- 搜索 --}}
<div class="row">
<div class="col-12">
<form action="{{ route('admin.users.index') }}" method="get">
<div class="form-row row">
<div class="col-2">
<input type="text" class="form-control" name="id" placeholder="用户 ID"
2023-01-30 05:17:24 +00:00
value="{{ request('id') }}" aria-label="用户 ID">
2022-11-21 04:55:44 +00:00
</div>
<div class="col-2">
<input type="text" class="form-control" name="name" placeholder="用户名"
2023-01-30 05:17:24 +00:00
value="{{ request('name') }}" aria-label="用户名">
2022-11-21 04:55:44 +00:00
</div>
<div class="col-2">
<input type="text" class="form-control" name="email" placeholder="邮箱"
2023-01-30 05:17:24 +00:00
value="{{ request('email') }}" aria-label="邮箱">
2022-11-21 04:55:44 +00:00
</div>
<div class="col-2">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
</div>
</div>
2022-11-18 09:16:30 +00:00
{{-- 用户列表 --}}
<div class="overflow-auto">
<table class="table table-hover">
<thead>
2022-11-18 10:09:51 +00:00
<th>ID</th>
2022-11-18 09:16:30 +00:00
<th>用户名</th>
<th>邮箱</th>
2022-11-18 11:39:30 +00:00
<th>余额</th>
2022-11-26 13:52:30 +00:00
<th>用户组</th>
2022-11-18 09:16:30 +00:00
<th>注册时间</th>
<th>操作</th>
</thead>
<tbody>
@foreach ($users as $user)
<tr>
<td>
2022-11-18 10:09:51 +00:00
<a href="{{ route('admin.users.show', $user) }}" title="切换到 {{ $user->name }}">
{{ $user->id }}
</a>
</td>
<td>
<a href="{{ route('admin.users.edit', $user) }}" title="显示和编辑 {{ $user->name }} 的资料">
2022-11-18 09:16:30 +00:00
{{ $user->name }}
</a>
</td>
<td>
2023-03-06 11:22:34 +00:00
{{ $user->email }} @if(!$user->hasVerifiedEmail())
<small class="text-muted">没有验证</small>
@endif
2022-11-18 09:16:30 +00:00
</td>
<td>
2023-01-30 05:17:24 +00:00
@if ($user->hasBalance())
<span class="text-danger">{{ $user->balance }} </span>
@else
<span class="text-muted">{{ $user->balance }} </span>
@endif
2022-11-18 09:16:30 +00:00
</td>
2022-11-26 13:52:30 +00:00
<td>
2022-11-26 14:26:16 +00:00
@if ($user->user_group_id)
2022-11-26 13:52:30 +00:00
<a href="{{ route('admin.user-groups.show', $user->user_group_id) }}">
{{ $user->user_group->name }}
</a>
@else
@endif
</td>
2022-11-18 09:16:30 +00:00
<td>
{{ $user->created_at }}
</td>
<td>
2022-11-18 09:20:03 +00:00
<a href="{{ route('admin.users.edit', $user) }}" class="btn btn-primary btn-sm">编辑</a>
2022-11-18 09:16:30 +00:00
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- 分页 --}}
{{ $users->links() }}
2022-11-16 01:52:53 +00:00
@endsection