refill.order.notify.err.index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <style>
  2. th label {
  3. display: inline-block;
  4. width: 60px;
  5. }
  6. .lineLi {
  7. display: inline-block;
  8. min-width: 150px;
  9. font-size: 14px;
  10. }
  11. .page .fixed-bar .item-title h3 {
  12. margin-top:18px !important;
  13. margin-bottom:10px !important;
  14. font-weight:700 !important;
  15. }
  16. .tab-base li span {
  17. font-size:12px !important;
  18. }
  19. .layui-form-select .layui-input {
  20. height:23px;
  21. padding-left: 11px;
  22. padding-right: 0!important;
  23. }
  24. input::placeholder{
  25. color:#333;
  26. }
  27. .layui-form-selected dl {
  28. display: flex!important;
  29. flex-wrap: wrap!important;
  30. }
  31. .layui-form-select dl {
  32. top: 29px !important;
  33. left: 4px!important;
  34. min-width: 802%!important;
  35. max-height: 280px!important;
  36. padding: 14px 0!important;
  37. }
  38. .layui-form-select dl dd.layui-this{
  39. display: none;
  40. }
  41. .layui-form-select dl dd {
  42. cursor: pointer;
  43. width: 130px;
  44. }
  45. .lefto {
  46. margin-left: 6px;
  47. width: 127px;
  48. }
  49. .db-right {
  50. padding-right: 134px!important;
  51. border-bottom: 1px solid #ccc;
  52. }
  53. .db-center {
  54. padding: 9px 0;
  55. border-bottom: 1px solid #ccc;
  56. }
  57. .db-top {
  58. padding: 0 30px;
  59. }
  60. </style>
  61. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  62. <div class="page">
  63. <div class="fixed-bar">
  64. <div class="item-title">
  65. <h3>问题订单监控</h3>
  66. <ul class="tab-base">
  67. <li><a href="index.php?act=ordersendlist&op=index"><span>商户超时订单监控</span></a></li>
  68. <li><a href="index.php?act=ordersendlist&op=monitor_notify"><span>渠道回调超时监控</span></a></li>
  69. <li><a href="index.php?act=ordersendlist&op=neterr_order"><span>网络错误订单监控</span></a></li>
  70. <li><a href="JavaScript:void(0);" class="current"><span>未回调订单监控</span></a></li>
  71. </ul>
  72. </div>
  73. </div>
  74. <div class="fixed-empty"></div>
  75. <form method="get" action="index.php" name="formSearch" id="formSearch">
  76. <input type="hidden" name="act" value="OrderSendList"/>
  77. <input type="hidden" name="op" value="notify_err_order"/>
  78. <table class="tb-type1 noborder search">
  79. <tr>
  80. <th><label class="lefto">近期时间(小时内)</label></th>
  81. <td class="layui-form">
  82. <select name="time" class="querySelect" id="time_id" lay-verify="" lay-search lay-filter="time_id">
  83. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  84. <?php for ($i = 1; $i<=12; $i++) { ?>
  85. <option value="<?php echo $i; ?>"<?php if ($_GET['time'] == $i){ ?>selected<?php } ?>><?php echo $i;?>小时</option>
  86. <?php } ?>
  87. </select>
  88. </td>
  89. <th style="padding-left: 15px;">回调时间</th>
  90. <td>
  91. <select name="notify_time" class="querySelect" id="arrangeClass">
  92. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  93. <option value="1"
  94. <?php if ($_GET['notify_time'] == '1'){ ?>selected<?php } ?>>1秒</option>
  95. <option value="15"
  96. <?php if ($_GET['notify_time'] == '15'){ ?>selected<?php } ?>>15秒</option>
  97. <?php for ($i = 1; $i <= 5; $i++){?>
  98. <option value="<?php echo $i*60;?>"
  99. <?php if ($_GET['notify_time'] == $i*60){ ?>selected<?php } ?>><?php echo $i;?>分钟</option>
  100. <?php }?>
  101. <option value="600"
  102. <?php if ($_GET['notify_time'] == '600'){ ?>selected<?php } ?>>10分钟</option>
  103. <option value="900"
  104. <?php if ($_GET['notify_time'] == '900'){ ?>selected<?php } ?>>15分钟</option>
  105. </select>
  106. </td>
  107. <td>
  108. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  109. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  110. </a>
  111. </td>
  112. </tr>
  113. </table>
  114. <table class="tb-type1 noborder search">
  115. <tr>
  116. <td>
  117. <a href="#" class="btns" onclick="hCopyChannel(event)">
  118. <span><i class="icon-edit"></i>拷贝订单号</span>
  119. </a>
  120. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  121. <span><i class="icon-edit"></i>拷贝充值卡号</span>
  122. </a>
  123. <a href="#" id="btn_time" class="btns">
  124. <span><i class="icon-edit"></i>批量回调</span>
  125. </a>
  126. </td>
  127. </tr>
  128. </table>
  129. </form>
  130. <table class="table tb-type2 nobdb">
  131. <thead>
  132. <tr class="thead">
  133. <th class="align-center">编号</th>
  134. <th class="align-center">订单号</th>
  135. <th class="align-center">机构编号</th>
  136. <th class="align-center">机构名称</th>
  137. <th class="align-center">充值卡号</th>
  138. <th class="align-center">充值卡类型</th>
  139. <th class="align-center">充值额度</th>
  140. <th class="align-right">下单日期</th>
  141. <th class="align-right">耗时</th>
  142. <th class="align-center">订单状态</th>
  143. <th class="align-center">通道质量</th>
  144. <th class="align-center">失败原因</th>
  145. <th class="align-center">商家单号</th>
  146. <th class="align-center">扣款金额</th>
  147. <th class="align-center">渠道单号</th>
  148. <th class="align-center">渠道名称</th>
  149. <th class="align-center">回调状态</th>
  150. <th class="align-center">回调次数</th>
  151. </tr>
  152. </thead>
  153. <tbody id="tbody">
  154. <?php if (count($output['order_list']) > 0) { ?>
  155. <?php
  156. foreach ($output['order_list'] as $key => $order) { ?>
  157. <tr class="hover trFlex">
  158. <td class="align-center"><?php echo $key + 1; ?></td>
  159. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  160. <td class="align-center"><?php echo $order['mchid']; ?></td>
  161. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  162. <td class="align-left"><?php echo $order['card_no']; ?></td>
  163. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  164. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  165. <td class="align-right">
  166. <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  167. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  168. </span>
  169. </td>
  170. <td class="align-right">
  171. <?php if (empty($order['notify_time'])) {
  172. if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  173. ?>
  174. <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
  175. <?php } elseif ($order['diff_time'] > 3600) { ?>
  176. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  177. <?php } else {
  178. ?>
  179. <?php echo $order['diff_time_text'] ?>
  180. <?php } ?>
  181. <?php } else { ?>
  182. <?php echo $order['diff_time_text'] ?>
  183. <?php } ?>
  184. </td>
  185. <td class="align-center"><?php echo orderState($order); ?></td>
  186. <td class="align-left"><?php echo $order['quality_text']; ?></td>
  187. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  188. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  189. <td class="align-center"><?php echo $order['mch_amount']; ?></td>
  190. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  191. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  192. <td class="align-center">
  193. <?php if($order['mch_notify_state'] == 0){?>
  194. 回调未确认
  195. <?php }elseif($order['mch_notify_state'] == 1){?>
  196. 回调已确认
  197. <?php }elseif($order['mch_notify_state'] == 2){?>
  198. 已停止回调
  199. <?php }?>
  200. </td>
  201. <td class="align-center"><?php echo $order['mch_notify_times']; ?></td>
  202. </tr>
  203. <?php } ?>
  204. <?php } else { ?>
  205. <tr class="no_data">
  206. <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
  207. </tr>
  208. <?php } ?>
  209. </tbody>
  210. <tfoot>
  211. <tr class="tfoot">
  212. <td colspan="18" id="dataFuncs">
  213. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  214. </td>
  215. </tr>
  216. </tfoot>
  217. </table>
  218. <!-- 预警提示 -->
  219. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  220. </div>
  221. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  222. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  223. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  224. charset="utf-8"></script>
  225. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  226. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  227. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  228. <link rel="stylesheet" type="text/css"
  229. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  230. <script type="text/javascript">
  231. $(function () {
  232. $('#ncsubmit').click(function () {
  233. $('#formSearch').submit();
  234. });
  235. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  236. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  237. // 日期选择器
  238. laydate.render({
  239. elem: '#startTime',
  240. type: 'datetime'
  241. });
  242. laydate.render({
  243. elem: '#endTime',
  244. type: 'datetime'
  245. });
  246. //批量回调
  247. $('#btn_time').click(() => {
  248. let time1 = $("#time_id option:selected").val()
  249. let time2 = $("#arrangeClass option:selected").val()
  250. console.log(time1, time2);
  251. window.location.href =`index.php?act=OrderSendList&op=notifyerr_all_notify&time= ${time1 ? time1 : ''} &notify_time= ${time2 ? time2 : ''}`
  252. })
  253. layui.use(['form'], function(){
  254. var form = layui.form;
  255. form.on('select(time_id)', function (data) {
  256. const time3 = data.value;
  257. console.log(time3);
  258. form.render('select')
  259. $("select[name='notify_time']").blur(function(){
  260. const time4 = $(this).val()
  261. console.log(time4)
  262. $('#btn_time').click(() =>{
  263. console.log(time3, time4);
  264. window.location.href = `index.php?act=OrderSendList&op=notifyerr_all_notify&time= ${time3} &notify_time= ${time4}`
  265. })
  266. });
  267. })
  268. })
  269. let isWring = '<?php echo $output['count'][1];?>';
  270. // console.log('isWring', Number(isWring));
  271. let setTimer
  272. let num
  273. if (Number(isWring) > 0) {
  274. window.clearTimeout(setTimer)
  275. setTimer = setTimeout(function () {
  276. $("#auto")[0].play();
  277. // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
  278. }, 1000);
  279. window.clearTimeout(num)
  280. num = setTimeout(function () {
  281. window.location.reload();
  282. }, 60000);
  283. }
  284. // 表格hover时背景
  285. $('.trFlex').each(function () {
  286. $(this).hover(function () {
  287. $(this)[0].style.backgroundColor = '#cbe9f3'
  288. }, function () {
  289. $(this)[0].style.backgroundColor = '#fff'
  290. })
  291. })
  292. //双击
  293. $('.doubleclick').dblclick(function() {
  294. let db_click = $(this).attr('data-order')
  295. $.get('index.php?act=refill_order&op=showOrders', {
  296. order_sn:db_click
  297. }, function(data) {
  298. data = JSON.parse(data)
  299. if (data.state == 1) {
  300. var dbclick = data.data
  301. let ConentArr = [];
  302. let html = '';
  303. for (let i = 0; i < dbclick.length; i++) {
  304. var item = dbclick[i];
  305. html += `
  306. <tr>
  307. <td class="db-center">${item.order_sn}</td>
  308. <td class="db-center">${item.commit_time_text}</td>
  309. <td class="db-center">${item.notify_time_text}</td>
  310. <td class="db-center">${item.diff_time_text}</td>
  311. <td class="db-center">${item.order_state_text}</td>
  312. <td class="db-center">${item.channel_name}</td>
  313. <td class="db-center">${item.err_msg}</td>
  314. <td class="db-center">${item.close_reason}</td>
  315. <tr>
  316. `
  317. }
  318. layer.open({
  319. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
  320. content: `<table>
  321. <thead>
  322. <tr>
  323. <th class="db-right">订单号</th>
  324. <th class="db-right">下单日期</th>
  325. <th class="db-right">回调日期</th>
  326. <th class="db-right">耗时</th>
  327. <th class="db-right">订单状态</th>
  328. <th class="db-right">供方名称</th>
  329. <th class="db-right">错误原因(充值)</th>
  330. <th class="db-right">错误原因(订单)</th>
  331. </tr>
  332. </thead>
  333. <tbody>
  334. ${html}
  335. </tbody>
  336. </table>`,
  337. });
  338. } else {
  339. alert("没有此订单");
  340. }
  341. })
  342. })
  343. // 供方名称颜色
  344. $('.textColor').each(function () {
  345. let color = $(this).attr('data-color')
  346. if (color == '1') {
  347. $(this).css('color', 'green')
  348. } else {
  349. $(this).css('color', 'red')
  350. }
  351. })
  352. });
  353. function hCopyChannel(e) {
  354. let str = ''
  355. $('#tbody tr').each(function () {
  356. let res = $(this).find('td').eq(1).text()
  357. str += res + '\n'
  358. })
  359. let oInput = document.createElement("textarea");
  360. oInput.style.border = "0 none";
  361. oInput.style.color = "transparent";
  362. oInput.value = str;
  363. document.body.appendChild(oInput);
  364. oInput.select(); // 选择对象
  365. document.execCommand("Copy"); // 执行浏览器复制命令
  366. oInput.parentNode.removeChild(oInput)
  367. }
  368. function hCopyCardNo(e) {
  369. let str = ''
  370. $('#tbody tr').each(function () {
  371. let res = $(this).find('td').eq(4).text()
  372. str += res + '\n'
  373. })
  374. let oInput = document.createElement("textarea");
  375. oInput.style.border = "0 none";
  376. oInput.style.color = "transparent";
  377. oInput.value = str;
  378. document.body.appendChild(oInput);
  379. oInput.select(); // 选择对象
  380. document.execCommand("Copy"); // 执行浏览器复制命令
  381. oInput.parentNode.removeChild(oInput)
  382. }
  383. </script>