exempt_review_update.blade.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="row">
  7. <div class="col-12 grid-margin stretch-card">
  8. <div class="card">
  9. <div class="card-body">
  10. <h4 class="card-title">{{ __('auto.请填写管理员信息') }}</h4>
  11. <form class="forms-sample" id="form">
  12. <div class="form-group">
  13. <h4>{{ __('auto.菜单名称') }}</h4>
  14. <input type="text" class="form-control required" name="name" placeholder="{{ __('auto.请输入菜单名称') }}" value="{{ $info->name }}">
  15. </div>
  16. <div>
  17. <label for="recharge">
  18. <input type="checkbox" name="recharge_checkbox" id="recharge" @if ($info->recharge_checkbox > 0)
  19. checked
  20. @endif>
  21. {{ __('auto.累计咖啡额度范围设置') }}
  22. </label>
  23. <br>
  24. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  25. <label>* 下限值</label>
  26. <input type="number" class="form-control" name="recharge_min" placeholder="{{ __('auto.下限值') }}" value="{{ $info->recharge_min }}">
  27. </div>
  28. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  29. <label>* 上限值</label>
  30. <input type="number" class="form-control" name="recharge_max" placeholder="{{ __('auto.上限值') }}" value="{{ $info->recharge_max }}">
  31. </div>
  32. </div>
  33. <div>
  34. <label for="draw">
  35. <input type="checkbox" name="draw_checkbox" id="draw" @if ($info->type > 0)
  36. checked
  37. @endif>
  38. {{ __('auto.单个玩家可免审核茶叶额度') }}
  39. </label> <br>
  40. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  41. <label> <input type="radio" name="type" id="optionsRadios2" value="1" @if ($info->type == 1)
  42. checked
  43. @endif>
  44. {{ __('auto.固定额度') }}</label>
  45. <input type="number" class="form-control" name="quota" placeholder="{{ __('auto.固定额度') }}" @if ($info->type == 1)
  46. value="{{ $info->quota }}"
  47. @endif>
  48. </div>
  49. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  50. <label>* <input type="radio" name="type" id="optionsRadios2" value="2" @if ($info->type ==2 )
  51. checked
  52. @endif>
  53. {{ __('auto.固定倍数') }}</label>
  54. <input type="number" class="form-control" name="multiple" placeholder="{{ __('auto.固定倍数') }}" id="multiple" @if ($info->type == 2)
  55. value="{{ $info->quota }}"
  56. @endif>
  57. </div>
  58. </div>
  59. <div>
  60. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  61. <label> <input type="checkbox" name="draw_gt_recharge_checkbox" @if ($info->draw_gt_recharge > 0)
  62. checked
  63. @endif>
  64. {{ __('auto.茶叶大于咖啡,设置超过值:') }}</label>
  65. <input type="number" class="form-control" name="draw_gt_recharge" placeholder="{{ __('auto.茶叶大于咖啡') }}"
  66. id="quota" value="{{ $info->draw_gt_recharge }}">
  67. </div>
  68. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  69. <label>* <input type="checkbox" name="draw_total_checkbox" @if ($info->draw_total >0)
  70. checked
  71. @endif>
  72. {{ __('auto.茶叶总额超过,设置超过值:') }}</label>
  73. <input type="number" class="form-control" name="draw_total" placeholder="{{ __('auto.茶叶总额超过') }}"
  74. id="multiple" value="{{ $info->draw_total }}">
  75. </div>
  76. </div>
  77. <div>
  78. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  79. <label> <input type="checkbox" name="draw_bi_checkbox" @if ($info->draw_bi > 0)
  80. checked
  81. @endif>
  82. {{ __('auto.单日茶叶笔数超过,设置超过值:') }}</label>
  83. <input type="number" class="form-control" name="draw_bi" placeholder="{{ __('auto.单日茶叶笔数超过') }}"
  84. id="quota" value="{{ $info->draw_bi }}">
  85. </div>
  86. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  87. <label>* <input type="checkbox" name="game_time_checkbox" @if ($info->game_time > 0)
  88. checked
  89. @endif>
  90. {{ __('auto.总游戏时长低于,设置值(小时):') }}</label>
  91. <input type="number" class="form-control" name="game_time" placeholder="{{ __('auto.总游戏时长低于') }}"
  92. id="multiple" value="{{ $info->game_time }}">
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label for=""><h4>{{ __('auto.每日申请总额度设置') }}</h4></label> <br>
  97. <label for="nickname">
  98. {{ __('auto.当前每日累计消耗额度/每日总额度:') }}
  99. </label>
  100. {{ __('auto.添加') }} / {{ __('auto.减少额度') }}<input type="text" class="form-control required" name="total_quota"
  101. placeholder="{{ __('auto.每日总额度设置') }}" value="{{ $info->total_quota }}">
  102. </div>
  103. <div class="form-group">
  104. <label for=""><h4>{{ __('auto.开关设置') }}</h4></label> <br>
  105. <label> <input type="radio" name="status" id="optionsRadios2" value="1" @if ($info->status == 1)
  106. checked
  107. @endif> {{ __('auto.开启') }}</label>
  108. <label> <input type="radio" name="status" id="optionsRadios2" value="2" @if ($info->status == 2)
  109. checked
  110. @endif> {{ __('auto.关闭') }}</label>
  111. </div>
  112. <div class="form-group" style="margin-top: 20px;">
  113. <label><h4>{{ __('auto.代付渠道配置') }}</h4></label>
  114. <p class="text-muted">{{ __('auto.以下为当前可用的代付渠道及其权重比例(从admin_configs表读取)') }}</p>
  115. <div class="table-responsive">
  116. <table class="table table-bordered table-striped">
  117. <thead class="bg-light">
  118. <tr>
  119. <th width="30%">{{ __('auto.渠道名称') }}</th>
  120. <th width="20%">{{ __('auto.渠道值') }}</th>
  121. <th width="20%">{{ __('auto.权重比例') }}(%)</th>
  122. <th width="15%">{{ __('auto.状态') }}</th>
  123. <th width="15%">{{ __('auto.修改人') }}</th>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. @php
  128. $totalSort = 0;
  129. $activeCount = 0;
  130. @endphp
  131. @foreach($agent as $val)
  132. @php
  133. if ($val->status == 1) {
  134. $totalSort += $val->sort;
  135. $activeCount++;
  136. }
  137. @endphp
  138. <tr class="{{ $val->status == 1 ? 'table-success' : 'table-secondary' }}">
  139. <td><strong>{{ $val->name }}</strong></td>
  140. <td>{{ $val->config_value }}</td>
  141. <td>
  142. <span class="badge badge-{{ $val->status == 1 ? 'primary' : 'secondary' }} badge-pill" style="font-size: 14px;">
  143. {{ $val->sort }}%
  144. </span>
  145. </td>
  146. <td>
  147. @if($val->status == 1)
  148. <span class="badge badge-success">{{ __('auto.开启') }}</span>
  149. @else
  150. <span class="badge badge-danger">{{ __('auto.关闭') }}</span>
  151. @endif
  152. </td>
  153. <td>{{ $val->admin_id ?? '-' }}</td>
  154. </tr>
  155. @endforeach
  156. </tbody>
  157. <tfoot>
  158. <tr class="bg-light">
  159. <td colspan="2" class="text-right"><strong>{{ __('auto.开启渠道权重总和') }}:</strong></td>
  160. <td>
  161. <strong class="text-{{ $totalSort == 100 ? 'success' : 'danger' }}" style="font-size: 16px;">
  162. {{ $totalSort }}%
  163. @if($totalSort == 100)
  164. <i class="mdi mdi-check-circle text-success"></i>
  165. @else
  166. <i class="mdi mdi-alert-circle text-danger"></i>
  167. @endif
  168. </strong>
  169. </td>
  170. <td colspan="2">
  171. <small class="text-muted">{{ __('auto.已开启') }}: {{ $activeCount }} {{ __('auto.个渠道') }}</small>
  172. </td>
  173. </tr>
  174. </tfoot>
  175. </table>
  176. </div>
  177. <div class="alert alert-info" role="alert">
  178. <i class="mdi mdi-information"></i>
  179. <strong>{{ __('auto.说明') }}:</strong>
  180. <ul class="mb-0">
  181. <li>{{ __('auto.代付渠道配置从 admin_configs 表中读取,在') }} <a href="/admin/recharge/config/cash" target="_blank">{{ __('auto.代付渠道管理') }}</a> {{ __('auto.中进行修改') }}</li>
  182. <li>{{ __('auto.系统会根据开启渠道的权重比例自动分配代付任务') }}</li>
  183. <li>{{ __('auto.开启的渠道权重总和应为 100%') }}</li>
  184. </ul>
  185. </div>
  186. </div>
  187. <button type="button" onclick="commit({{ $info->id }})"
  188. class="btn btn-sm btn-gradient-primary btn-icon-text">
  189. <i class="mdi mdi-file-check btn-icon-prepend"></i>
  190. {{ __('auto.提交') }}
  191. </button>
  192. <button type="button" onclick="cancel()"
  193. class="btn btn-sm btn-gradient-warning btn-icon-text">
  194. <i class="mdi mdi-reload btn-icon-prepend"></i>
  195. {{ __('auto.取消') }}
  196. </button>
  197. </form>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. <script>
  205. function commit(id) {
  206. if (!checkForm()) {
  207. return false;
  208. }
  209. var data = $("#form").serializeObject();
  210. if (! data.draw_bi_checkbox){
  211. data.draw_bi = 0
  212. }
  213. if (! data.draw_gt_recharge_checkbox){
  214. data.draw_gt_recharge = 0
  215. }
  216. if (! data.draw_total_checkbox){
  217. data.draw_total = 0
  218. }
  219. if (! data.game_time_checkbox){
  220. data.game_time = 0
  221. }
  222. if (! data.recharge_checkbox){
  223. data.recharge_max = 0
  224. data.recharge_min = 0
  225. }
  226. if (! data.draw_checkbox){
  227. data.type = 0
  228. }
  229. let type = data.type
  230. if (type == 1 && data.quota == '') {
  231. layer.msg('{{ __('auto.固定额度不能为空') }}');
  232. return false;
  233. }
  234. if (type == 2 && data.multiple == '') {
  235. layer.msg('{{ __('auto.固定倍数不能为空') }}');
  236. return false;
  237. }
  238. if (parseInt(data.recharge_min) > parseInt(data.recharge_max)) {
  239. layer.msg('{{ __('auto.下限值不能大于上限') }}');
  240. return false;
  241. }
  242. if (data.quota != '' && (data.quota < 0 || data.quota > 1000000)) {
  243. layer.msg('{{ __('auto.固定额度区间为') }}0-1000000');
  244. return false;
  245. }
  246. if (data.multiple != '' && (data.multiple < 1 || data.multiple > 100)) {
  247. layer.msg('{{ __('auto.固定倍数区间为') }}1-100');
  248. return false;
  249. }
  250. if (data.multiple != '' && type == 2) {
  251. data.quota = data.multiple
  252. }
  253. myRequest("/admin/withdrawal/exempt_review_update/"+id, "post", data, function (res) {
  254. if (res.code == '200') {
  255. layer.msg(res.msg)
  256. setTimeout(function () {
  257. parent.location.reload();
  258. }, 1500)
  259. } else {
  260. layer.msg(res.msg)
  261. }
  262. });
  263. }
  264. function cancel() {
  265. parent.location.reload();
  266. }
  267. </script>
  268. @endsection