analysis.new_version.mch_order_send.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <style>
  2. #checkChannel {
  3. border-spacing: 0;
  4. border-collapse: collapse;
  5. }
  6. #checkChannel td {
  7. height: 20px;
  8. padding: 2px;
  9. background: #F3FBFE;
  10. border: 1px solid #fff;
  11. display: block;
  12. white-space: nowrap;
  13. font-size: 10px;
  14. }
  15. #checkChannel tr {
  16. height: 20px;
  17. }
  18. #checkChannel thead tr {
  19. table-layout: fixed;
  20. top: 0;
  21. left: 0;
  22. }
  23. #checkChannel tbody {
  24. height: calc(100vh - 210px);
  25. display: block;
  26. overflow-y: scroll;
  27. }
  28. .echartsContent {
  29. display: flex;
  30. height: calc(100vh - 150px);
  31. }
  32. #echart {
  33. flex: 1;
  34. margin-left: 5px;
  35. }
  36. #echart img {
  37. width: 100%;
  38. }
  39. </style>
  40. <div class="page">
  41. <div class="fixed-bar">
  42. <div class="item-title">
  43. <h3>成功率监控列表</h3>
  44. <ul class="tab-base">
  45. <li><a href="?index.php&act=refill_analysis&op=index&type=provider"><span>通道成功率监控</span></a></li>
  46. <li><a href="?index.php&act=refill_analysis&op=index&type=system"><span>平台成功率监控</span></a></li>
  47. <li><a href="?index.php&act=refill_analysis&op=merchant_ratios"><span>机构成功率统计</span></a></li>
  48. <li><a href="?index.php&act=refill_analysis&op=new_version&type=provider"><span>新通道成功率监控</span></a></li>
  49. <li><a href="?index.php&act=refill_analysis&op=new_version&type=system"><span>新平台成功率监控</span></a></li>
  50. <li><a href="JavaScript:void(0);" class="current"><span>机构单量监控</span></a></li>
  51. </ul>
  52. </div>
  53. </div>
  54. <div class="fixed-empty"></div>
  55. <div style="margin-top: 10px;color: #e60d0d;">
  56. 请先选择时间
  57. </div>
  58. <form method="get" action="index.php" name="formSearch" id="formSearch" style="min-width: 1200px;">
  59. <table class="tb-type1 noborder search tableFixed">
  60. <tr>
  61. <th><label for="query_start_time">统计时间</label></th>
  62. <td>
  63. <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>" id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
  64. <label for="query_start_time">~</label>
  65. <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>" id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
  66. </td>
  67. <!-- <th><label>机构选择</label></th>
  68. <td>
  69. <div id="select_merchants"></div>
  70. </td> -->
  71. <th><label>卡类型</label></th>
  72. <td>
  73. <div id="select_cardtypes"></div>
  74. </td>
  75. <th><label>面额</label></th>
  76. <td>
  77. <select name="amount">
  78. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  79. <option value="10" <?php if ($_GET['refill_amount'] == '10') { ?>selected<?php } ?>>10</option>
  80. <option value="20" <?php if ($_GET['refill_amount'] == '20') { ?>selected<?php } ?>>20</option>
  81. <option value="30" <?php if ($_GET['refill_amount'] == '30') { ?>selected<?php } ?>>30</option>
  82. <option value="50" <?php if ($_GET['refill_amount'] == '50') { ?>selected<?php } ?>>50</option>
  83. <option value="100" <?php if ($_GET['refill_amount'] == '100') { ?>selected<?php } ?>>100</option>
  84. <option value="200" <?php if ($_GET['refill_amount'] == '200') { ?>selected<?php } ?>>200</option>
  85. <option value="300" <?php if ($_GET['refill_amount'] == '300') { ?>selected<?php } ?>>300</option>
  86. <option value="500" <?php if ($_GET['refill_amount'] == '500') { ?>selected<?php } ?>>500</option>
  87. <option value="1000" <?php if ($_GET['refill_amount'] == '1000') { ?>selected<?php } ?>>1000</option>
  88. <option value="2000" <?php if ($_GET['refill_amount'] == '2000') { ?>selected<?php } ?>>2000</option>
  89. </select>
  90. </td>
  91. <th><label>滤波器</label></th>
  92. <td>
  93. <select name="filter_wave">
  94. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  95. <option value="60">1分钟</option>
  96. <option value="300">5分钟</option>
  97. <option value="600">10分钟</option>
  98. <option value="900">15分钟</option>
  99. <option value="0" selected>关闭</option>
  100. </select>
  101. </td>
  102. <td>
  103. <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="<?php echo $lang['nc_query']; ?>">&nbsp;
  104. </a>
  105. </td>
  106. </tr>
  107. </table>
  108. </form>
  109. <div class="echartsContent">
  110. <table id="checkChannel">
  111. <thead>
  112. <tr>
  113. <td>
  114. <label>
  115. <input type="checkbox" id="checkAllChannel">
  116. 编号(机构列表)
  117. </label>
  118. </td>
  119. </tr>
  120. </thead>
  121. <tbody id="checkChannelContent">
  122. </tbody>
  123. </table>
  124. <div id="echart">
  125. </div>
  126. </div>
  127. <div id="box">
  128. <!-- <iframe
  129. src="https://www.xyzshops.cn/plot/index?time_stamp=1621488600&interval=60" scrolling="no" id="Iframe" frameborder="0"></iframe> -->
  130. </div>
  131. </div>
  132. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  133. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  134. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
  135. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/js/xm-select.js"></script>
  136. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/layer.js"></script>
  137. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/moment-with-locales.js"></script>
  138. <link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css" />
  139. <script type="text/javascript">
  140. $(function() {
  141. laydate.render({
  142. elem: '#startTime',
  143. type: 'datetime'
  144. });
  145. laydate.render({
  146. elem: '#endTime',
  147. type: 'datetime'
  148. });
  149. function formatChannelTable(tableData) {
  150. let data;
  151. if (typeof tableData == 'object') {
  152. data = tableData;
  153. } else {
  154. data = JSON.parse(tableData)
  155. }
  156. let tableHTML = '';
  157. data.map(item => {
  158. tableHTML += `
  159. <tr>
  160. <td><label><input type="checkbox" name="channelValue"" value="${item.value}" />${item.name}</label></td>
  161. </tr>
  162. `;
  163. })
  164. $('#checkChannelContent').append(tableHTML);
  165. }
  166. // let select_merchants
  167. $.get('index.php?act=refill_analysis&op=merchant_data', function(data) {
  168. data = JSON.parse(data)
  169. formatChannelTable(data)
  170. // select_merchants = xmSelect.render({
  171. // el: '#select_merchants',
  172. // size: 'mini',
  173. // filterable: true,
  174. // style: {
  175. // minHeight: '27px',
  176. // lineHeight: '27px',
  177. // marginLeft: '4px',
  178. // width: '250px'
  179. // },
  180. // language: 'zn',
  181. // data: data
  182. // })
  183. })
  184. let select_cardtypes
  185. $.get('index.php?act=refill_analysis&op=card_type_data', function(data) {
  186. data = JSON.parse(data)
  187. select_cardtypes = xmSelect.render({
  188. el: '#select_cardtypes',
  189. size: 'mini',
  190. filterable: true,
  191. style: {
  192. minHeight: '27px',
  193. lineHeight: '27px',
  194. marginLeft: '4px',
  195. width: '250px'
  196. },
  197. language: 'zn',
  198. data: data
  199. })
  200. })
  201. function select_set(selectArr) {
  202. let selectStr = ''
  203. for (let i = 0; i < selectArr.length; i++) {
  204. selectStr += selectArr[i].value + ','
  205. }
  206. selectStr = selectStr.substr(0, selectStr.length - 1)
  207. return selectStr
  208. }
  209. $('#checkAllChannel').click(function() {
  210. if ($(this).get(0).checked) {
  211. $('input[name="channelValue"]').attr('checked', 'checked')
  212. } else {
  213. $('input[name="channelValue"]').removeAttr('checked')
  214. }
  215. })
  216. $('#ncsubmit').click(function() {
  217. let query_start_time = $("input[name=query_start_time]").val()
  218. let start_time = parseInt((new Date(query_start_time)).getTime() / 1000);
  219. let query_end_time = $("input[name=query_end_time]").val()
  220. let end_time = parseInt((new Date(query_end_time)).getTime() / 1000);
  221. if (!start_time && !end_time) {
  222. start_time = Date.parse(new Date()) / 1000 - 7200;
  223. end_time = Date.parse(new Date()) / 1000;
  224. }
  225. // let mchids = select_set(select_merchants.getValue())
  226. let mchidList = [];
  227. $('input[name="channelValue"]').each(function() {
  228. if ($(this).attr('checked')) {
  229. mchidList.push($(this).attr('value'))
  230. }
  231. })
  232. let mchids = mchidList.join(',');
  233. let card_types = select_cardtypes && select_set(select_cardtypes.getValue())
  234. let spec = $("select[name=amount]").val()
  235. let filter_wave = $("select[name=filter_wave]").val()
  236. let src = window.location.origin + "/plot/mch_order_send?"
  237. if (start_time) {
  238. src += "&start_time=" + start_time;
  239. }
  240. if (end_time) {
  241. if (end_time < start_time || !start_time) {
  242. layer.msg('日期有误,结束日期需大于开始日期');
  243. return
  244. }
  245. src += "&end_time=" + end_time;
  246. }
  247. if (mchids) {
  248. src += "&mchids=" + mchids;
  249. }
  250. if (card_types) {
  251. src += "&card_types=" + card_types;
  252. }
  253. if (spec) {
  254. src += "&spec=" + spec;
  255. }
  256. if (filter_wave > 0) {
  257. src += '&filter_wave=' + filter_wave;
  258. }
  259. $.get(src, function(data) {
  260. $('#echart').html(data)
  261. });
  262. });
  263. $('#ncsubmit').trigger('click');
  264. })
  265. </script>