refill.order.index.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <style>
  2. th label { display: inline-block;width: 60px; }
  3. </style>
  4. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  5. <div class="page">
  6. <div class="fixed-bar">
  7. <div class="item-title">
  8. <h3>订单列表</h3>
  9. <ul class="tab-base">
  10. <li><a href="JavaScript:void(0);" class="current"><span>管理</span></a></li>
  11. </ul>
  12. </div>
  13. </div>
  14. <div class="fixed-empty"></div>
  15. <form method="get" action="index.php" name="formSearch" id="formSearch">
  16. <input type="hidden" name="act" value="merchant"/>
  17. <input type="hidden" name="op" value="refill_order"/>
  18. <table class="tb-type1 noborder search">
  19. <tbody>
  20. <tr>
  21. <th><label>我方订单号</label></th>
  22. <td><input class="txt2" type="text" name="order_sn" value="<?php echo $_GET['order_sn']; ?>"/></td>
  23. <th><label>客户订单号</label></th>
  24. <td><input class="txt2" type="text" name="mch_order" value="<?php echo $_GET['mch_order']; ?>"/></td>
  25. <th><label>供方订单号</label></th>
  26. <td><input class="txt2" type="text" name="ch_trade_no" value="<?php echo $_GET['ch_trade_no']; ?>"/></td>
  27. </tr>
  28. <tr>
  29. <th><label>客户名称</label></th>
  30. <td><input class="txt2" type="text" name="mchid" value="<?php echo $_GET['mchid']; ?>"/></td>
  31. <th><label>供方名称</label></th>
  32. <td>
  33. <select name="store_id" class="querySelect">
  34. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  35. <?php foreach($output['provider_list'] as $provider){?>
  36. <option value="<?php echo $provider['store_id']?>"
  37. <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>><?php echo $provider['name']?>
  38. </option>
  39. <?php }?>
  40. </select>
  41. </td>
  42. </tr>
  43. <tr>
  44. <th><label>充值卡卡号</label></th>
  45. <td><input class="txt2" type="text" name="card_no" value="<?php echo $_GET['card_no']; ?>"/></td>
  46. </tr>
  47. <tr>
  48. <th><label for="query_start_time">下单时间</label></th>
  49. <td>
  50. <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
  51. id="startTime" name="query_start_time" autocomplete="off" />
  52. <label for="query_start_time">~</label>
  53. <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
  54. id="endTime" name="query_end_time" autocomplete="off"/></td>
  55. <th><label>订单状态</label></th>
  56. <td>
  57. <select name="order_state" class="querySelect">
  58. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  59. <option value="10"
  60. <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
  61. <option value="20"
  62. <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
  63. <option value="30"
  64. <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
  65. <option value="40"
  66. <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
  67. <option value="0"
  68. <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
  69. </select>
  70. <label>充值类型</label>
  71. <select name="card_type" class="querySelect">
  72. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  73. <option value="1"
  74. <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油</option>
  75. <option value="2"
  76. <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化</option>
  77. <option value="4"
  78. <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动</option>
  79. <option value="5"
  80. <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
  81. <option value="6"
  82. <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
  83. <option value="oil"
  84. <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费</option>
  85. <option value="phone"
  86. <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费</option>
  87. </select>
  88. </td>
  89. <th><label>交易面额</label></th>
  90. <td>
  91. <select name="refill_amount" class="querySelect">
  92. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  93. <option value="10"
  94. <?php if ($_GET['refill_amount'] == '10'){ ?>selected<?php } ?>>10</option>
  95. <option value="20"
  96. <?php if ($_GET['refill_amount'] == '20'){ ?>selected<?php } ?>>20</option>
  97. <option value="30"
  98. <?php if ($_GET['refill_amount'] == '30'){ ?>selected<?php } ?>>30</option>
  99. <option value="50"
  100. <?php if ($_GET['refill_amount'] == '50'){ ?>selected<?php } ?>>50</option>
  101. <option value="100"
  102. <?php if ($_GET['refill_amount'] == '100'){ ?>selected<?php } ?>>100</option>
  103. <option value="200"
  104. <?php if ($_GET['refill_amount'] == '200'){ ?>selected<?php } ?>>200</option>
  105. <option value="300"
  106. <?php if ($_GET['refill_amount'] == '300'){ ?>selected<?php } ?>>300</option>
  107. <option value="500"
  108. <?php if ($_GET['refill_amount'] == '500'){ ?>selected<?php } ?>>500</option>
  109. <option value="1000"
  110. <?php if ($_GET['refill_amount'] == '1000'){ ?>selected<?php } ?>>1000</option>
  111. <option value="2000"
  112. <?php if ($_GET['refill_amount'] == '2000'){ ?>selected<?php } ?>>2000</option>
  113. </select>
  114. <label>充值耗时</label>
  115. <select name="time" class="querySelect">
  116. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  117. <option value="1"
  118. <?php if ($_GET['time'] == '1'){ ?>selected<?php } ?>>耗时半小时</option>
  119. <option value="2"
  120. <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时一小时</option>
  121. </select>
  122. </td>
  123. <td>
  124. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  125. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  126. </a>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td></td>
  131. <td>
  132. <a href="#" class="btns" onclick="hCopyChannel(event)">
  133. <span><i class="icon-edit"></i>拷贝供方单号</span>
  134. </a>
  135. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  136. <span><i class="icon-edit"></i>拷贝充值卡号</span>
  137. </a>
  138. </td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. </form>
  143. <table class="table tb-type2" id="prompt">
  144. <tbody>
  145. <tr class="space odd">
  146. <th colspan="12"><div class="title"><h5>
  147. 金额统计</h5><span class="arrow"></span></div></th>
  148. </tr>
  149. <tr>
  150. <td>
  151. <ul>
  152. <li>总计充值金额:<?php echo $output['stat']['refill_amounts'] ?? 0?></li>
  153. <li>总计供方扣款金额:<?php echo $output['stat']['channel_amounts'] ?? 0?></li>
  154. <li>总计客户扣款金额:<?php echo $output['stat']['mch_amounts'] ?? 0?></li>
  155. <li>总计利润:<?php echo ncPriceFormat($output['stat']['channel_amounts'] - $output['stat']['mch_amounts'])?></li>
  156. <li>总计订单数量:<?php echo $output['stat']['order_count'] ?? 0?></li>
  157. <li>超过半小时订单数量:<?php echo $output['count']['half_count'] ?? 0?></li>
  158. <li>超过一小时订单数量:<?php echo $output['count']['hour_count'] ?? 0?></li>
  159. </ul>
  160. </td>
  161. </tr>
  162. </tbody>
  163. </table>
  164. <table class="table tb-type2 nobdb">
  165. <thead>
  166. <tr class="thead">
  167. <th class="align-center">编号</th>
  168. <th class="align-center">订单号</th>
  169. <th class="align-center">机构编号</th>
  170. <th class="align-center">机构名称</th>
  171. <th class="align-center">充值卡号</th>
  172. <th class="align-center">充值卡类型</th>
  173. <th class="align-center">充值额度</th>
  174. <th class="align-right">下单日期</th>
  175. <th class="align-right">耗时</th>
  176. <th class="align-center">订单状态</th>
  177. <th class="align-center">运营商流水号</th>
  178. <th class="align-center">失败原因</th>
  179. <th class="align-center">商家单号</th>
  180. <th class="align-center">扣款金额</th>
  181. <th class="align-center">渠道单号</th>
  182. <th class="align-center">渠道名称</th>
  183. <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
  184. </tr>
  185. </thead>
  186. <tbody id="tbody">
  187. <?php if (count($output['order_list']) > 0) { ?>
  188. <?php
  189. foreach ($output['order_list'] as $key => $order) { ?>
  190. <tr class="hover">
  191. <td class="align-center"><?php echo $key+1;?></td>
  192. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  193. <td class="align-center"><?php echo $order['mchid']; ?></td>
  194. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  195. <td class="align-left"><?php echo $order['card_no']; ?></td>
  196. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  197. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  198. <td class="align-right"><?php echo date('Y-m-d H:i:s', $order['order_time']); ?></td>
  199. <td class="align-right">
  200. <?php if(empty($order['notify_time'])) {
  201. if($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  202. ?>
  203. <span style="color: #fd9d0e"><?php echo $order['diff_time_text']?></span>
  204. <?php }elseif($order['diff_time'] > 3600) {?>
  205. <span style="color: #f30707"><?php echo $order['diff_time_text']?></span>
  206. <?php }else{?>
  207. <?php echo $order['diff_time_text']?>
  208. <?php }?>
  209. <?php }else{?>
  210. <?php echo $order['diff_time_text']?>
  211. <?php }?>
  212. </td>
  213. <td class="align-center"><?php echo orderState($order); ?></td>
  214. <td class="align-left"><?php echo $order['official_sn']; ?></td>
  215. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  216. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  217. <td class="align-center"><?php echo $order['mch_amount']; ?></td>
  218. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  219. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  220. <td class="w144 align-center">
  221. <a href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
  222. 回调</a>
  223. |
  224. <a href="index.php?act=merchant&op=notify_manual_merchant&type=cancel&order_id=<?php echo $order['order_id']; ?>">
  225. 手动失败</a>
  226. |
  227. <a href="index.php?act=merchant&op=notify_manual_merchant&type=success&order_id=<?php echo $order['order_id']; ?>">
  228. 手动成功</a>
  229. </td>
  230. </tr>
  231. <?php } ?>
  232. <?php } else { ?>
  233. <tr class="no_data">
  234. <td colspan="17"><?php echo $lang['nc_no_record']; ?></td>
  235. </tr>
  236. <?php } ?>
  237. </tbody>
  238. <tfoot>
  239. <tr class="tfoot">
  240. <td colspan="15" id="dataFuncs">
  241. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  242. </td>
  243. </tr>
  244. </tfoot>
  245. </table>
  246. </div>
  247. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  248. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  249. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  250. charset="utf-8"></script>
  251. <link rel="stylesheet" type="text/css"
  252. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  253. <script type="text/javascript">
  254. $(function () {
  255. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  256. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  257. $('#ncsubmit').click(function () {
  258. $('input[name="op"]').val('refill_order');
  259. $('#formSearch').submit();
  260. });
  261. // 日期选择器
  262. laydate.render({
  263. elem: '#startTime',
  264. type: 'datetime'
  265. });
  266. laydate.render({
  267. elem: '#endTime',
  268. type: 'datetime'
  269. });
  270. });
  271. function hCopyChannel(e) {
  272. let str = ''
  273. $('#tbody tr').each(function () {
  274. let res = $(this).find('td').eq(14).text()
  275. str += res + '\n'
  276. })
  277. let oInput = document.createElement("textarea");
  278. oInput.style.border = "0 none";
  279. oInput.style.color = "transparent";
  280. oInput.value = str;
  281. document.body.appendChild(oInput);
  282. oInput.select(); // 选择对象
  283. document.execCommand("Copy"); // 执行浏览器复制命令
  284. oInput.parentNode.removeChild(oInput)
  285. }
  286. function hCopyCardNo(e) {
  287. let str = ''
  288. $('#tbody tr').each(function () {
  289. let res = $(this).find('td').eq(4).text()
  290. str += res + '\n'
  291. })
  292. let oInput = document.createElement("textarea");
  293. oInput.style.border = "0 none";
  294. oInput.style.color = "transparent";
  295. oInput.value = str;
  296. document.body.appendChild(oInput);
  297. oInput.select(); // 选择对象
  298. document.execCommand("Copy"); // 执行浏览器复制命令
  299. oInput.parentNode.removeChild(oInput)
  300. }
  301. </script>