index.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. {extend name="layout/content"/} {block name="header"}
  2. <link rel="stylesheet" href="__STATIC__/css/admin/bootstrap.min.css">
  3. <link rel="stylesheet" href="__STATIC__/css/admin/bootstrap-table.css?v={$Think.STATIC_VERSION}">
  4. <link rel="stylesheet" href="__STATIC__/css/FuzzySearch.css?v={$Think.STATIC_VERSION}">
  5. <title>充值记录管理</title>
  6. <style>
  7. label {
  8. padding-top: 10px;
  9. margin-left: 10px;
  10. }
  11. .x-so {
  12. text-align: unset;
  13. margin-bottom: 20px;
  14. }
  15. section {
  16. margin-top: 10px;
  17. display: flex;
  18. }
  19. .layui-input {
  20. margin-right: 5px;
  21. }
  22. .set_width {
  23. margin-right: 5px;
  24. }
  25. .hide {
  26. display: none;
  27. }
  28. .glyphicon-plus:before {
  29. content: "\002b";
  30. font-size: 12px;
  31. font-weight: 900;
  32. width: 100%;
  33. display: inline-block;
  34. }
  35. .glyphicon-minus:before {
  36. content: "\2212";
  37. font-size: 12px;
  38. font-weight: 900;
  39. width: 100%;
  40. display: inline-block;
  41. }
  42. .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
  43. padding: 8px;
  44. line-height: 1.42857143;
  45. vertical-align: middle !important;
  46. border-top: 1px solid #ddd;
  47. }
  48. table td,
  49. table th {
  50. text-align: center;
  51. }
  52. .detail-view td,
  53. .detail-view th {
  54. text-align: left;
  55. }
  56. .badge-default{
  57. color: #333;
  58. background-color: #fff;
  59. }
  60. .badge-success{
  61. background-color: #449d44;
  62. }
  63. .badge-danger{
  64. background-color: #d9534f;
  65. }
  66. :hover .noLine{
  67. text-decoration-line: none;
  68. }
  69. .layui-inline{
  70. margin-top: 10px;
  71. }
  72. </style>
  73. {/block} {block name="content"}
  74. <div class="x-body">
  75. <form class="layui-form" method="GET" action="{:url('index')}">
  76. <div class="layui-inline">
  77. <div class="layui-input-inline">
  78. <input class="layui-input" placeholder="开始时间" name="start" id="start" readonly='readonly' value="{$start}" autocomplete="off">
  79. </div>
  80. <span>-</span>
  81. <div class="layui-input-inline">
  82. <input class="layui-input" placeholder="结束时间" name="end" id="end" readonly='readonly' value="{$end}" autocomplete="off">
  83. </div>
  84. </div>
  85. <div class="layui-inline">
  86. <label>游戏:</label>
  87. <div class="layui-input-inline FuzzySearch_Container">
  88. <div>
  89. <input type="hidden" id='J_gameid' name="gameid" value="{$Request.get.gameid}" />
  90. </div>
  91. </div>
  92. </div>
  93. <div class="layui-inline">
  94. <label>区服名称:</label>
  95. <div class="layui-input-inline">
  96. <input class="layui-input" placeholder="区服名称" name="servername" value="{$Request.get.servername}">
  97. </div>
  98. </div>
  99. <div class="layui-inline">
  100. <label>充值状态:</label>
  101. <div class="layui-input-inline">
  102. <select name="status">
  103. <option value="">选择支付状态</option>
  104. <option value="0" {if condition="$Request.get.status eq '0' " }selected="selected" {/if}>待支付</option>
  105. <option value="1" {if condition="$Request.get.status eq 1 " }selected="selected" {/if}>支付成功</option>
  106. <option value="2" {if condition="$Request.get.status eq 2 " }selected="selected" {/if}>支付失败</option>
  107. </select>
  108. </div>
  109. </div>
  110. <div class="layui-inline">
  111. <label>发货状态:</label>
  112. <div class="layui-input-inline">
  113. <select name="cp_status">
  114. <option value="">选择发货状态</option>
  115. <option value="0" {if condition="$Request.get.cp_status eq '0' " }selected="selected" {/if}>发货失败/未发货</option>
  116. <option value="1" {if condition="$Request.get.cp_status eq 1 " }selected="selected" {/if}>发货成功</option>
  117. </select>
  118. </div>
  119. </div>
  120. <div class="layui-inline">
  121. <label>支付方式:</label>
  122. <div class="layui-input-inline">
  123. <select name="paytype">
  124. <option value="">选择支付方式</option>
  125. {volist name="new_pay_type" id="pvo"}
  126. <option value="{$key}" {if condition="$Request.get.paytype eq $key" }selected="selected" {/if}>{$pvo}</option>
  127. {/volist}
  128. </select>
  129. </div>
  130. </div>
  131. <div class="layui-inline">
  132. <div class="layui-input-inline">
  133. <input class="layui-input" placeholder="订单号" id="orderid" name="orderid" value="{$Request.get.orderid}">
  134. </div>
  135. </div>
  136. <div class="layui-inline">
  137. <div class="layui-input-inline">
  138. <input class="layui-input" placeholder="玩家账号" name="username" value="{$Request.get.username}">
  139. </div>
  140. </div>
  141. <div class="layui-inline">
  142. <div class="layui-input-inline FuzzySearch_Container">
  143. <div>
  144. <input type="hidden" id='J_channelid' placeholder="请输入推广员账号" name="channel_id" value="{$channel_id}" />
  145. </div>
  146. </div>
  147. </div>
  148. <div class="layui-inline">
  149. <div class="layui-input-inline FuzzySearch_Container">
  150. <div>
  151. <input type="hidden" id='J_parent_channel_id' placeholder="请输入公会账号" name="parent_channel_id" value="{$Request.get.parent_channel_id}" />
  152. </div>
  153. </div>
  154. </div>
  155. <div class="layui-inline">
  156. <div class="layui-input-inline">
  157. <select name="bplus_channel_id" lay-filter="level" value="{:input('request.bplus_channel_id')}">
  158. <option value="">请选择商务</option>
  159. {volist name="uniom" id="vo"}
  160. <option value="{$vo.id}" {if condition="input('request.bplus_channel_id') eq $vo.id" }selected="selected" {/if} >{$vo.name}</option>
  161. {/volist}
  162. </select>
  163. </div>
  164. </div>
  165. <div class="layui-inline">
  166. <button class="layui-btn" type="submit" id="J_search_submit">查询</button>
  167. <a href="{:url()}" class="layui-btn layui-btn-primary">重置</a>
  168. <a class="layui-btn" href="javascript:void(0);" onclick="reportDownload(0);">下载报表</a>
  169. <!-- <a class="layui-btn" href="javascript:void(0);" onclick="reportDownload(1);">下载报表(高级)</a>-->
  170. </div>
  171. <!--
  172. <p style="margin-top:10px;">
  173. <span style="color: red">*</span><a class="noLine" style="color: #666"> 单次查询日期的最长跨度为31天</a>
  174. </p>
  175. -->
  176. <!-- data-toolbar="#toolbar" -->
  177. <table data-toggle="table" data-detail-view="true" data-detail-formatter="detailFormatter" class="table">
  178. <thead>
  179. <tr>
  180. <!-- 1-5 -->
  181. <th>订单号</th>
  182. <th>游戏名称</th>
  183. <th>账号</th>
  184. <th>区服名称</th>
  185. <th>充值金额</th>
  186. <!-- 6-10 -->
  187. <th>支付金额</th>
  188. <th>平台币支付</th>
  189. <th>专属平台币支付</th>
  190. <th>代金券</th>
  191. <th>第三方支付</th>
  192. <!-- 11-15 -->
  193. <th>支付方式</th>
  194. <th>支付状态</th>
  195. <th>发货状态</th>
  196. <th>推广员账号</th>
  197. <th>子会长</th>
  198. <!-- 16-20 -->
  199. <th>商务账号</th>
  200. <th>公会账号</th>
  201. <th>角色名</th>
  202. <th class="hide">区服ID</th>
  203. <th>区服名</th>
  204. <!-- 21-25 -->
  205. <th class="hide">注册时间</th>
  206. <th class="hide">角色ID</th>
  207. <th class="hide">等级</th>
  208. <th class="hide">商品名</th>
  209. <th class="hide">关联代金券id</th>
  210. <!-- 26-28 -->
  211. <th class="hide">订单ID</th>
  212. <th>充值时间</th>
  213. <th>操作</th>
  214. </tr>
  215. </thead>
  216. <tbody id="viewer_wrap">
  217. {empty name="list"}
  218. {else/} {volist name="list" id="vo"}
  219. <tr>
  220. <!-- 1-5 -->
  221. <td>{$vo.orderid}</td>
  222. <td>{$vo.game_name}</td>
  223. <!-- <td id="J_td_{$vo.id}"><a href="javascript:void(0);" onclick="showUsername({$vo.userid},{$vo.gameid},{$vo.id})" style="text-decoration: underline;">{:stringObfuscation($vo.username)}</a></td> -->
  224. <td>{$vo.username}</td>
  225. <td>{$vo.servername}</td>
  226. <td><i class="fa fa-cny"></i>{$vo.amount}</td>
  227. <!-- 6-10 -->
  228. <td><i class="fa fa-cny"></i>{$vo.pay_amount}</td>
  229. <td><i class="fa fa-cny"></i>{$vo.real_coin}</td>
  230. <td><i class="fa fa-cny"></i>{$vo.real_ptb}</td>
  231. <td><i class="fa fa-cny"></i>{$vo.coupon_amount}</td>
  232. <td><i class="fa fa-cny"></i>{$vo.real_amount}</td>
  233. <!-- 11-15 -->
  234. <td><sup>{:config('paytype.'.$vo.paytype)}</sup></td>
  235. <td>
  236. {switch name="vo.status"} {case value="0"}
  237. <span class="badge badge-default">待支付</span>
  238. {/case} {case value="1"}
  239. <span class="badge badge-success">成功</span>
  240. {/case} {case value="2"}
  241. <span class="badge badge-info">已取消</span>
  242. {/case} {/switch}
  243. </td>
  244. <td class="type{$vo.orderid}">
  245. {if condition="$vo.cp_status eq 1"}
  246. <span class="badge badge-default">发货成功</span>
  247. {elseif condition="$vo.cp_status neq 1"}
  248. {if condition="$vo.status eq 1"}
  249. <span class="badge badge-danger">发货失败</span>
  250. {else/}
  251. <span class="badge badge-danger">未发货</span>
  252. {/if}
  253. {/if}
  254. </td>
  255. <td>{$vo.channel_name}</td>
  256. <td>{$vo.second_channel}</td>
  257. <!-- 16-20 -->
  258. <td>{$vo.top_channel}</td>
  259. <td>{$vo.union_name}</td>
  260. <td>{$vo.rolename}</td>
  261. <td>{$vo.serverid}</td>
  262. <td>{$vo.servername}</td>
  263. <td>{$vo.reg_time}</td>
  264. <!-- 21-25 -->
  265. <td>{$vo.roleid}</td>
  266. <td>{$vo.rolelevel}</td>
  267. <td>{$vo.productname}</td>
  268. <td>{$vo.id}</td>
  269. <td>{$vo.coupon_member_id}</td>
  270. <!-- 26-27 -->
  271. <td>{$vo.pay_time}</td>
  272. <td>
  273. <button type="button" title="查看" class="layui-btn layui-btn-normal J_show_attach" data-orderid="{$vo.orderid}" data-attach="{$vo.attach}">附加信息</button>
  274. {if condition="$vo.status eq 1"}
  275. {empty name="vo.cp_status"}
  276. <button type="button" title="查看" class="layui-btn layui-btn-normal reCallback" data-orderid="{$vo.orderid}">补单</button>
  277. {/empty}
  278. {/if}
  279. </td>
  280. </tr>
  281. {/volist} {/empty}
  282. </tbody>
  283. </table>
  284. <div class="pager-container" style="margin-top:10px;">
  285. <span>
  286. 充值完成总金额:{$totalAmount}元,{$list->total()}条记录; 今日充值:{$todayTotalAmount}元 ; 昨日充值:{$lastDayTotalAmount}元
  287. </span>
  288. {$page}
  289. <div class="layui-inline" style="margin:0;margin-left:10px;width:80px;">
  290. <input type="text" style="height: 30px;" class="layui-input" placeholder="跳转至" name="page" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">
  291. </div>
  292. </div>
  293. </form>
  294. </div>
  295. {/block}
  296. {block name="footer"}
  297. <script type="text/javascript" src="__STATIC__/js/admin/bootstrap-table.js?v={$Think.STATIC_VERSION}"></script>
  298. <script type="text/javascript" src="__STATIC__/js/FuzzySearch.js?v={$Think.STATIC_VERSION}"></script>
  299. <script>
  300. $(document).ready(function () {
  301. $("#J_gameid").FuzzySearch({
  302. inputID : 'J_gameid',
  303. title : '请输入游戏名称',
  304. data :{:json_encode($game_list)},
  305. searchBtn :'J_search_submit',
  306. });
  307. $("#J_channelid").FuzzySearch({
  308. inputID : 'J_channelid',
  309. title : '请输入推广员账号',
  310. searchBtn :'J_search_submit',
  311. ajaxUrl : '{:url("Pay/ajaxGetNoComplexChannel")}',
  312. });
  313. $("#J_parent_channel_id").FuzzySearch({
  314. inputID : 'J_parent_channel_id',
  315. title : '请选择公会账号',
  316. //searchBtn :'J_search_submit',
  317. ajaxUrl : '{:url("Pay/ajaxGetNoComplexChannel")}',
  318. });
  319. layui.use(['form', 'laydate'], function () {
  320. var laydate = layui.laydate;
  321. var form = layui.form;
  322. var starttime = laydate.render({
  323. elem: '#start',
  324. type: 'date',
  325. format: 'yyyy-MM-dd',
  326. done: function (value, dates) {
  327. endtime.config.min = {
  328. year: dates.year,
  329. month: dates.month - 1, //关键
  330. date: dates.date,
  331. hours: 0,
  332. minutes: 0,
  333. seconds: 0
  334. };
  335. }
  336. });
  337. var endtime = laydate.render({
  338. elem: '#end',
  339. type: 'date',
  340. format: 'yyyy-MM-dd',
  341. done: function (value, dates) {
  342. starttime.config.max = {
  343. year: dates.year,
  344. month: dates.month - 1, //关键
  345. date: dates.date,
  346. hours: 0,
  347. minutes: 0,
  348. seconds: 0
  349. }
  350. }
  351. });
  352. /**
  353. * 查看附加信息按钮点击事件
  354. */
  355. $('table tbody tr td').on('click', ".J_show_attach",function () {
  356. var orderid = $(this).data('orderid');
  357. $.ajax({
  358. type: "post",
  359. data: {'orderid':orderid},
  360. url: "{:url('showAttach')}",
  361. dataType: "json",
  362. timeOut: 10,
  363. success: function (msg) {
  364. if(msg.code) {
  365. var attach = msg.msg;
  366. var html = '<div>';
  367. html += attach;
  368. html += '</div>';
  369. layer.open({
  370. type: 1,
  371. title: '合作方订单号',
  372. skin: 'layui-layer-rim',
  373. area: ['420px', '240px'], //宽高
  374. content: html,
  375. });
  376. if (window.top !== window.self) {
  377. window.parent.$('html, body').animate({
  378. scrollTop: 0
  379. }, 'slow');
  380. }
  381. }else{
  382. layer.alert(msg.msg, {icon: 5});
  383. }
  384. },
  385. error: function () {
  386. layer.alert('网络错误,请刷新页面重试!', {icon: 2});
  387. }
  388. });
  389. });
  390. /*
  391. 一键发货
  392. */
  393. $('table tbody tr td').on('click', ".reCallback",function (e) {
  394. var self = this;
  395. var orderid = $(this).data('orderid');
  396. $.ajax({
  397. type: "post",
  398. data: {'orderid':orderid},
  399. url: "{:url('reCallback')}",
  400. dataType: "json",
  401. timeOut: 10,
  402. success: function (msg) {
  403. if(msg.code) {
  404. layer.alert(msg.msg);
  405. $('.type'+orderid).html('<span class="badge badge-default">发货成功</span>');
  406. self.remove();
  407. }else{
  408. layer.alert(msg.msg, {icon: 5});
  409. }
  410. },
  411. error: function () {
  412. layer.alert('网络错误,请刷新页面重试!', {icon: 2});
  413. }
  414. });
  415. });
  416. });
  417. });
  418. /**
  419. * 下载
  420. */
  421. function reportDownload(is_show)
  422. {
  423. var start_time = $('#start').val();
  424. var end_time = $('#end').val();
  425. /*
  426. if (!end_time || !start_time) {
  427. layer.msg('请选择开始时间和结束时间');
  428. return;
  429. }
  430. */
  431. /*
  432. if ((CompareDate(start_time, end_time)) > 7) {
  433. layer.msg('请选择7天以内的时间范围');
  434. return;
  435. }*/
  436. $.ajax({
  437. type: "post",
  438. url: "{:url('download')}",
  439. async: false,
  440. data: $('.layui-form').serialize()+'&is_show='+is_show+'&is_haiwei=0&gh=1',
  441. dataType: 'json',
  442. timeout: 5000,
  443. success: function (data) {
  444. if (data['code']) {
  445. layer.alert(data['msg']);
  446. } else {
  447. layer.alert(data['msg']);
  448. }
  449. },
  450. error: function () {
  451. layer.alert('网络错误,请重试');
  452. },
  453. });
  454. }
  455. var $table = $("table");
  456. $table.bootstrapTable({
  457. formatNoMatches: function () {
  458. return "暂无数据";
  459. }
  460. });
  461. function detailFormatter(index, row) {
  462. var html = [];
  463. var obj = {
  464. 0: "订单号",
  465. 1: "游戏名称",
  466. 2: "账号",
  467. 3: "区分名称",
  468. 4: "充值金额",
  469. 5: "支付金额",
  470. 6: "平台币支付",
  471. 7: "专属平台币支付",
  472. 8: "代金券",
  473. 9: "第三方支付",
  474. 10: "支付方式",
  475. 11: "支付状态",
  476. 12: "发货状态",
  477. 13: "推广员账号",
  478. 14: "子会长",
  479. 15: "会长账号",
  480. 16: "角色名",
  481. 17: "商务账号",
  482. 18: "区服ID",
  483. 19: "注册时间",
  484. 20: "角色ID",
  485. 21: "等级",
  486. 22: "商品名",
  487. 23: "关联代金券id",
  488. 24: "订单ID",
  489. 25: "充值时间",
  490. }
  491. $.each(row, function (key, value) {
  492. if (key == 0 || (key >= 16 && key <= 24)) {
  493. html.push('<p><b>' + obj[key] + ':</b> ' + value + '</p>');
  494. } else {
  495. html.push('<p class="hide"><b>' + obj[key] + ':</b> ' + value + '</p>');
  496. }
  497. });
  498. return html.join('');
  499. }
  500. //显示全部姓名
  501. function showUsername(userid,game_id,id)
  502. {
  503. $.ajax({
  504. type: "post",
  505. data: {'userid':userid,'game_id':game_id},
  506. url: "{:url('showUsername')}",
  507. dataType: "json",
  508. timeOut: 10,
  509. success: function (result) {
  510. if(result.code) {
  511. $('#J_td_'+id).html(result.data);
  512. }else{
  513. layer.alert(result.msg, {icon: 5});
  514. }
  515. },
  516. error: function () {
  517. layer.alert('网络错误,请刷新页面重试!', {icon: 2});
  518. }
  519. });
  520. }
  521. </script>
  522. {/block}