verify.blade.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. @extends('base.base')
  2. @section('base')
  3. <div class="container-fluid">
  4. <div class="row">
  5. <div class="col-12">
  6. <div class="card">
  7. <div class="card-header">
  8. <h3 class="card-title">推广奖金审核</h3>
  9. <div class="card-tools">
  10. <form action="{{ route('admin.extension_new.verify') }}" method="get" class="form-inline">
  11. <div class="input-group input-group-sm">
  12. <input type="text" name="NickName" class="form-control" placeholder="昵称" value="{{ request('NickName') }}">
  13. <input type="text" name="GameID" class="form-control" placeholder="游戏ID" value="{{ request('GameID') }}">
  14. <input type="text" name="SpreaderID" class="form-control" placeholder="推广者ID" value="{{ request('SpreaderID') }}">
  15. <input type="text" name="start_time" class="form-control" placeholder="开始时间" value="{{ request('start_time') }}" id="start_time">
  16. <input type="text" name="end_time" class="form-control" placeholder="结束时间" value="{{ request('end_time') }}" id="end_time">
  17. <div class="input-group-append">
  18. <button type="submit" class="btn btn-default">搜索</button>
  19. </div>
  20. </div>
  21. </form>
  22. </div>
  23. </div>
  24. <div class="card-body table-responsive p-0">
  25. <table class="table table-hover text-nowrap">
  26. <thead>
  27. <tr>
  28. <th>ID</th>
  29. <th>用户昵称</th>
  30. <th>游戏ID</th>
  31. <th>推广者</th>
  32. <th>推广者等级</th>
  33. <th>注册时间</th>
  34. <th>充值金额</th>
  35. <th>佣金比例</th>
  36. <th>佣金金额</th>
  37. <th>状态</th>
  38. <th>操作</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. @foreach($list as $item)
  43. <tr>
  44. <td>{{ $item->id }}</td>
  45. <td>{{ $item->NickName }}</td>
  46. <td>{{ $item->GameID }}</td>
  47. <td>{{ $item->spreader->NickName ?? '' }}</td>
  48. <td>{{ $item->spreader_level }}</td>
  49. <td>{{ $item->RegisterDate }}</td>
  50. <td>{{ number_format($item->amount, 2) }}</td>
  51. <td>{{ $item->commission_rate }}%</td>
  52. <td>{{ number_format($item->commission_amount, 2) }}</td>
  53. <td>
  54. @if($item->status == 0)
  55. <span class="badge badge-warning">待审核</span>
  56. @elseif($item->status == 1)
  57. <span class="badge badge-success">已通过</span>
  58. @else
  59. <span class="badge badge-danger">已拒绝</span>
  60. @endif
  61. </td>
  62. <td>
  63. @if($item->status == 0)
  64. <button type="button" class="btn btn-sm btn-success" onclick="verifyRecord({{ $item->id }}, 1)">通过</button>
  65. <button type="button" class="btn btn-sm btn-danger" onclick="verifyRecord({{ $item->id }}, 2)">拒绝</button>
  66. @endif
  67. <button type="button" class="btn btn-sm btn-info" onclick="showRemarks({{ $item->id }})">备注</button>
  68. </td>
  69. </tr>
  70. @endforeach
  71. </tbody>
  72. </table>
  73. </div>
  74. <div class="card-footer clearfix">
  75. {{ $list->appends(request()->query())->links() }}
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <!-- 备注模态框 -->
  82. <div class="modal fade" id="remarksModal" tabindex="-1" role="dialog">
  83. <div class="modal-dialog" role="document">
  84. <div class="modal-content">
  85. <div class="modal-header">
  86. <h5 class="modal-title">添加备注</h5>
  87. <button type="button" class="close" data-dismiss="modal">
  88. <span>&times;</span>
  89. </button>
  90. </div>
  91. <div class="modal-body">
  92. <textarea id="remarks" class="form-control" rows="3"></textarea>
  93. </div>
  94. <div class="modal-footer">
  95. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  96. <button type="button" class="btn btn-primary" onclick="saveRemarks()">保存</button>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. @endsection
  102. @section('scripts')
  103. <script>
  104. $(function() {
  105. $('#start_time, #end_time').datetimepicker({
  106. format: 'YYYY-MM-DD HH:mm:ss'
  107. });
  108. });
  109. function verifyRecord(id, status) {
  110. if (!confirm('确定要' + (status == 1 ? '通过' : '拒绝') + '该记录吗?')) {
  111. return;
  112. }
  113. $.post('/admin/extension_new/verify_update/' + id, {
  114. status: status,
  115. _token: '{{ csrf_token() }}'
  116. }, function(res) {
  117. if (res.code === 0) {
  118. alert('操作成功');
  119. location.reload();
  120. } else {
  121. alert(res.msg || '操作失败');
  122. }
  123. });
  124. }
  125. var currentRecordId = 0;
  126. function showRemarks(id) {
  127. currentRecordId = id;
  128. $('#remarksModal').modal('show');
  129. }
  130. function saveRemarks() {
  131. if (!currentRecordId) return;
  132. $.post('/admin/extension_new/verify_remarks/' + currentRecordId, {
  133. remarks: $('#remarks').val(),
  134. _token: '{{ csrf_token() }}'
  135. }, function(res) {
  136. if (res.code === 0) {
  137. alert('保存成功');
  138. $('#remarksModal').modal('hide');
  139. location.reload();
  140. } else {
  141. alert(res.msg || '保存失败');
  142. }
  143. });
  144. }
  145. </script>
  146. @endsection