index.blade.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. @extends('base.base')
  2. @section('base')
  3. <div class="main-panel">
  4. <div class="content-wrapper">
  5. <div class="page-header">
  6. <h3 class="page-title">
  7. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  8. <i class="mdi mdi-trophy"></i>
  9. </span>
  10. 游戏输赢排行榜
  11. </h3>
  12. <nav aria-label="breadcrumb">
  13. <ol class="breadcrumb">
  14. <li class="breadcrumb-item"><a href="#">数据管理</a></li>
  15. <li class="breadcrumb-item active" aria-current="page">游戏输赢排行榜</li>
  16. </ol>
  17. </nav>
  18. </div>
  19. <div class="col-lg-12 grid-margin stretch-card">
  20. <div class="card">
  21. <div class="card-body">
  22. <!-- 搜索表单 -->
  23. <form method="GET" action="/admin/game_data/winlose_rank" class="forms-sample">
  24. <div class="row">
  25. <div class="col-md-3">
  26. <div class="form-group">
  27. <label for="game_id">选择游戏</label>
  28. <select class="form-control" id="game_id" name="game_id" required>
  29. <option value="">请选择游戏</option>
  30. @foreach($games as $id => $name)
  31. <option value="{{ $id }}" {{ $gameId == $id ? 'selected' : '' }}>
  32. {{ $name }}
  33. </option>
  34. @endforeach
  35. </select>
  36. </div>
  37. </div>
  38. <div class="col-md-3">
  39. <div class="form-group">
  40. <label for="date">查询日期</label>
  41. <input type="date" class="form-control" id="date" name="date"
  42. value="{{ $date }}" required>
  43. </div>
  44. </div>
  45. <div class="col-md-3">
  46. <div class="form-group">
  47. <label for="type">排行类型</label>
  48. <select class="form-control" id="type" name="type">
  49. <option value="win" {{ $type == 'win' ? 'selected' : '' }}>赢分榜(≥100元)</option>
  50. <option value="lose" {{ $type == 'lose' ? 'selected' : '' }}>输分榜(≤-100元)</option>
  51. </select>
  52. </div>
  53. </div>
  54. <div class="col-md-3">
  55. <div class="form-group" style="margin-top: 30px;">
  56. <button type="submit" class="btn btn-gradient-primary mr-2">查询</button>
  57. <button type="reset" class="btn btn-light" onclick="resetForm()">重置</button>
  58. </div>
  59. </div>
  60. </div>
  61. </form>
  62. @if(!empty($rankData))
  63. <!-- 结果统计 -->
  64. <div class="row mb-3">
  65. <div class="col-md-12">
  66. <div class="alert alert-info">
  67. <strong>查询结果:</strong>
  68. {{ count($rankData) }} 个用户符合条件
  69. ({{ $games[$gameId] ?? '未知游戏' }} - {{ $date }} -
  70. {{ $type == 'win' ? '赢分榜' : '输分榜' }})
  71. </div>
  72. </div>
  73. </div>
  74. <!-- 排行榜表格 -->
  75. <div class="table-responsive">
  76. <table class="table table-striped">
  77. <thead>
  78. <tr>
  79. <th>排名</th>
  80. <th>用户ID</th>
  81. <th>昵称</th>
  82. <th>渠道</th>
  83. <th>注册日期</th>
  84. <th>最后登录</th>
  85. <th>输赢金额(元)</th>
  86. <th>操作</th>
  87. </tr>
  88. </thead>
  89. <tbody>
  90. @foreach($rankData as $item)
  91. <tr>
  92. <td>
  93. @if($item['rank'] <= 3)
  94. <span class="badge badge-{{ $item['rank'] == 1 ? 'warning' : ($item['rank'] == 2 ? 'secondary' : 'info') }}">
  95. {{ $item['rank'] }}
  96. </span>
  97. @else
  98. {{ $item['rank'] }}
  99. @endif
  100. </td>
  101. <td>{{ $item['game_id'] }}</td>
  102. <td>{{ $item['nick_name'] }}</td>
  103. <td>{{ $item['channel'] }}</td>
  104. <td>{{ $item['register_date'] }}</td>
  105. <td>{{ $item['last_logon_date'] }}</td>
  106. <td>
  107. <span class="badge badge-{{ $item['raw_amount'] > 0 ? 'success' : 'danger' }}">
  108. {{ $item['total_amount'] }}
  109. </span>
  110. </td>
  111. <td>
  112. <a href="/admin/global/id_find?UserID={{ $item['user_id'] }}"
  113. class="btn btn-sm btn-gradient-primary" target="_blank">
  114. 查看详情
  115. </a>
  116. </td>
  117. </tr>
  118. @endforeach
  119. </tbody>
  120. </table>
  121. </div>
  122. @else
  123. <div class="alert alert-warning">
  124. <strong>提示:</strong>请选择游戏和日期进行查询
  125. </div>
  126. @endif
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <script>
  133. function resetForm() {
  134. document.getElementById('game_id').value = '';
  135. document.getElementById('date').value = '{{ date("Y-m-d") }}';
  136. document.getElementById('type').value = 'win';
  137. }
  138. </script>
  139. <style>
  140. .table th {
  141. background-color: #f8f9fa;
  142. font-weight: 600;
  143. border-top: none;
  144. }
  145. .badge-warning {
  146. background-color: #ffc107 !important;
  147. }
  148. .badge-secondary {
  149. background-color: #6c757d !important;
  150. }
  151. .badge-info {
  152. background-color: #17a2b8 !important;
  153. }
  154. .alert {
  155. border-radius: 10px;
  156. }
  157. .card {
  158. border-radius: 15px;
  159. box-shadow: 0 0 20px rgba(0,0,0,0.1);
  160. }
  161. </style>
  162. @endsection