room.blade.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!doctype html>
  2. @extends('base.base')
  3. @section('base')
  4. <!-- 内容区域 -->
  5. <div class="main-panel">
  6. <div class="content-wrapper">
  7. <div class="page-header">
  8. <h3 class="page-title">
  9. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  10. <i class="mdi mdi-settings"></i>
  11. </span>
  12. {{ __('auto.群控房间配置') }}
  13. </h3>
  14. <nav aria-label="breadcrumb">
  15. <ol class="breadcrumb">
  16. <li class="breadcrumb-item"><a href="#">{{ __('auto.用户控制') }}</a></li>
  17. <li class="breadcrumb-item active" aria-current="page">{{ __('auto.群控房间配置') }}</li>
  18. </ol>
  19. </nav>
  20. </div>
  21. <div class="row">
  22. <div class="col-lg-12 grid-margin stretch-card">
  23. <div class="card">
  24. <div class="card-body">
  25. <h4 class="card-title">{{ __('auto.群控房间配置') }}</h4>
  26. <form class="well form-inline margin-top-20" method="get"
  27. action='/admin/group_control/room'>
  28. <span style="padding-left: 5px">{{ __('auto.游戏:') }}</span>
  29. <select class="form-control" name="kind_id" value="{{$kind_id}}" id="select"
  30. onchange="gradeChange(this.options[this.options.selectedIndex].value)">
  31. <option value="">{{ __('auto.选择游戏') }}</option>
  32. @foreach($game_name as $k=>$v)
  33. <option value="{{$k}}" @if($k==$kind_id) selected @endif >{{$v}}</option>
  34. @endforeach
  35. </select>
  36. <span style="padding-left: 5px">{{ __('auto.房间:') }}</span>
  37. <select class="form-control" name="game_level" value="" id="game_level">
  38. <option value="">{{ __('auto.选择房间') }}</option>
  39. @foreach($room_list as $k=>$v)
  40. <option value="{{$v->GameID}}-{{$v->SortID}}"
  41. @if(($v->GameID.'-'.$v->SortID)==$game_level) selected @endif>{{$v->RoomName}}</option>
  42. @endforeach
  43. </select> &nbsp;&nbsp;
  44. <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
  45. <a href="/admin/group_control/room"
  46. class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}&{{ __('auto.刷新') }}</a> &nbsp;&nbsp;
  47. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="add()">
  48. <i class="mdi mdi-plus btn-icon-prepend"></i>
  49. {{ __('auto.增加房间配置') }}
  50. </button>
  51. </form>
  52. <br>
  53. <table class="table table-bordered">
  54. <thead>
  55. <tr>
  56. <th >{{ __('auto.游戏') }}ID</th>
  57. <th >{{ __('auto.场次') }}</th>
  58. <th >{{ __('auto.房间名称') }}</th>
  59. <th >{{ __('auto.房间赢金币上限参数') }}</th>
  60. <th >{{ __('auto.房间新手保护') }}</th>
  61. <th >{{ __('auto.房间控制上限参数') }}</th>
  62. <th >{{ __('auto.底分参数') }}</th>
  63. <th >{{ __('auto.操作') }}</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. {{ gamesButton() }}
  68. @foreach($list as $k=>$v)
  69. <tr>
  70. <td>{{ $v->GameID }}</td>
  71. <td>{{ $v->SortID }}</td>
  72. <td>{{ $v->RoomName }}</td>
  73. <td>{{ $v->WinMax }}</td>
  74. <td>{{ $v->NewManProt }}</td>
  75. <td>{{ $v->ControlMax }}</td>
  76. <td>{{ $v->CellParam }}</td>
  77. <td>
  78. <button class="btn btn-sm btn-gradient-dark" onclick="edit({{$v->ID}})">{{ __('auto.修改') }}</button>
  79. </td>
  80. </tr>
  81. @endforeach
  82. </tbody>
  83. </table>
  84. <div class="box-footer clearfix">
  85. {{ __('auto.总共') }} <b>{{ $list->appends([
  86. 'kind_id'=>$kind_id,
  87. 'gameType' => $gameType
  88. ])->total() }}</b>
  89. {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
  90. {!! $list->links() !!}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <script>
  99. function add() {
  100. var page = layer.open({
  101. type: 2,
  102. title: '{{ __('auto.添加配置') }}',
  103. shadeClose: true,
  104. offset: 't',
  105. shade: 0.8,
  106. area: ['60%', '70%'],
  107. content: '/admin/group_control/room_add'
  108. });
  109. }
  110. function edit(id) {
  111. var page = layer.open({
  112. type: 2,
  113. title: '{{ __('auto.配置修改') }}',
  114. shadeClose: true,
  115. shade: 0.8,
  116. area: ['50%', '50%'],
  117. content: '/admin/group_control/room_update/' + id
  118. });
  119. }
  120. function show(GameID, SortID) {
  121. layer.ready(function () {
  122. // 弹框代码
  123. var page = layer.open({
  124. type: 2,
  125. title: '{{ __('auto.查看配置') }}',
  126. shadeClose: true,
  127. shade: 0.8,
  128. area: ['70%', '60%'],
  129. content: '/admin/group_control/show_control_config/' + GameID + '?SortID=' + SortID,
  130. });
  131. })
  132. }
  133. // 修改库存
  134. function update_stock(serverID) {
  135. var page = layer.open({
  136. type: 2,
  137. title: '{{ __('auto.修改库存') }}',
  138. shadeClose: true,
  139. shade: 0.8,
  140. area: ['50%', '40%'],
  141. content: '/admin/gold/update_stock/' + serverID
  142. });
  143. }
  144. // 更新库存
  145. function sync_res(obj, GameID, SortID) {
  146. // 库存
  147. var Revenue = $(obj).parents('tr').find('td').eq(3);
  148. var RevenueD = $(obj).parents('tr').find('td').eq(4);
  149. var Stock = $(obj).parents('tr').find('td').eq(6);
  150. var TurnOver = $(obj).parents('tr').find('td').eq(7);
  151. var Winlost = $(obj).parents('tr').find('td').eq(8);
  152. var ShaLv = $(obj).parents('tr').find('td').eq(9);
  153. var LostRate = $(obj).parents('tr').find('td').eq(10);
  154. var WinRate = $(obj).parents('tr').find('td').eq(11);
  155. // 税收
  156. // var revenue = $(obj).parents('tr').find('td').eq(3);
  157. myRequest("/admin/group_control/sync_res/" + GameID, "post", {SortID}, function (res) {
  158. layer.msg(res.msg)
  159. if (res.code == 200) {
  160. LostRateText = WinRateText = ''
  161. if (res.data.LostRate != '') {
  162. LostRateText = `{{ __('auto.系统') }} {{ __('auto.输') }} {{ __('auto.玩家') }}` + res.data.LostRate
  163. }
  164. if (res.data.WinRate != '') {
  165. WinRateText = `{{ __('auto.系统') }} {{ __('auto.赢') }} {{ __('auto.玩家') }}` + res.data.WinRate
  166. }
  167. Revenue.text(res.data.Revenue);
  168. RevenueD.text(res.data.RevenueD);
  169. Stock.text(res.data.Stock);
  170. TurnOver.text(res.data.TurnOver);
  171. Winlost.text(res.data.Winlost);
  172. ShaLv.text(res.data.ShaLv + '%');
  173. LostRate.text(LostRateText);
  174. WinRate.text(WinRateText);
  175. }
  176. });
  177. }
  178. function gradeChange(value) {
  179. myRequest("/admin/group_control/roomList", "post", {'GameID': value}, function (res) {
  180. var data = res.data
  181. var html = ''
  182. for (var i of data) {
  183. html += '<option value=' + i['GameID'] + '-' + i['SortID'] + '>' + i['RoomName'] + '</option>'
  184. }
  185. console.log(html)
  186. $("#game_level").html(html)
  187. });
  188. }
  189. </script>
  190. @endsection