provider.successful.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <div class="page">
  2. <div class="fixed-bar">
  3. <div class="item-title">
  4. <h3>成功率监控列表</h3>
  5. <ul class="tab-base">
  6. <li><a href="JavaScript:void(0);" class="current" ><span>通道成功率监控</span></a></li>
  7. </ul>
  8. </div>
  9. </div>
  10. <div class="fixed-empty"></div>
  11. <div style="margin-top: 10px;color: #e60d0d;">
  12. 请先选择时间
  13. </div>
  14. <form method="get" action="index.php" name="formSearch" id="formSearch">
  15. <input type="hidden" name="act" value="merchant"/>
  16. <input type="hidden" name="op" value="OrderSendList"/>
  17. <table class="tb-type1 noborder search tableFixed">
  18. <tr>
  19. <th><label>起始日期</label></th>
  20. <td>
  21. <select name="time_stamp" id="timeSelect">
  22. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  23. <?php foreach ($output['days'] as $day => $txt) {?>
  24. <option value="<?php echo $day; ?>"><?php echo $txt; ?></option>
  25. <?php }?>
  26. </select>
  27. </td>
  28. <th><label>起始时间</label></th>
  29. <td>
  30. <select name="time_hour">
  31. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  32. <?php for ($i = 1; $i <= 24; $i++) {?>
  33. <option value="<?php echo $i; ?>"><?php echo sprintf("%02d",$i); ?>点</option>
  34. <?php }?>
  35. </select>
  36. </td>
  37. <th><label>间隔</label></th>
  38. <td>
  39. <select name="interval">
  40. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  41. <option value="3600">一小时</option>
  42. <option value="1800">半小时</option>
  43. <option value="900" selected>15分钟</option>
  44. <option value="600" selected>10分钟</option>
  45. <option value="300" selected>5分钟</option>
  46. <option value="60">1分钟</option>
  47. </select>
  48. </td>
  49. <th><label>通道</label></th>
  50. <td>
  51. <select name="chname">
  52. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  53. </select>
  54. </td>
  55. <th><label>质量</label></th>
  56. <td>
  57. <select name="quality">
  58. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  59. </select>
  60. </td>
  61. <th><label>卡类型</label></th>
  62. <td>
  63. <select name="card_type">
  64. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  65. </select>
  66. </td>
  67. <th><label>面额</label></th>
  68. <td>
  69. <select name="amount">
  70. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  71. </select>
  72. </td>
  73. <td>
  74. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  75. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  76. </a>
  77. </td>
  78. </tr>
  79. </table>
  80. </form>
  81. <div>
  82. <iframe
  83. src="" scrolling="no" id="Iframe" frameborder="0"></iframe>
  84. </div>
  85. </div>
  86. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  87. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  88. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  89. charset="utf-8"></script>
  90. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  91. <link rel="stylesheet" type="text/css"
  92. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  93. <script type="text/javascript">
  94. $(function () {
  95. $("#Iframe").load(function(){
  96. $(this).css("min-height", '900px')
  97. $(this).css("min-width", '1650px')
  98. // var iframeHeight = $(this).contents().find("html").height();
  99. // var iframeWidth = $(this).contents().find("html").scrollWidth;
  100. // $(this).attr("height",iframeHeight)
  101. // $(this).attr("width",iframeWidth)
  102. // console.log('iframeHeight', iframeHeight, iframeWidth);
  103. });
  104. //默认获取 当前日期 当前时间点前一个小时, 间隔15 900
  105. // 前一个小时
  106. let frontOneHour = new Date(new Date().getTime() - 1 * 60 * 60 * 1000)
  107. let year = frontOneHour.getFullYear();
  108. let month = frontOneHour.getMonth() + 1;
  109. let date = frontOneHour.getDate();
  110. let hour = frontOneHour.getHours()
  111. let timestr = year+'-'+month+'-'+date
  112. let stamp = new Date(timestr).getTime()/1000
  113. $("select[name=time_stamp]").val(stamp)
  114. $("select[name=time_hour]").val(hour)
  115. // console.log('frontOneHour', frontOneHour,hour, stamp);
  116. let t = stamp + hour*3600
  117. let interval = $("select[name=interval]").val()
  118. let s = window.location.origin + "/plot/index?time_stamp=" + t + "&interval=" + interval
  119. $.get( s, function (data){
  120. if (!data) {
  121. return
  122. }
  123. $('iframe').attr('src',s)
  124. });
  125. $('#timeSelect').change(function () {
  126. let val = $(this).val()
  127. // console.log('val', val);
  128. $.get("index.php?act=merchant&op=successful_time_get_where&timestamp="+val, function (data){
  129. if (!data) {
  130. return
  131. }
  132. data = JSON.parse(data)
  133. $("select[name=chname]").find('.chnameOption').remove();
  134. $("select[name=quality]").find('.qualityOption').remove();
  135. $("select[name=card_type]").find('.ctOption').remove();
  136. $("select[name=amount]").find('.amountOption').remove();
  137. // 通道
  138. for (const key in data.chname) {
  139. $("select[name=chname]").append("<option class='chnameOption' value='"+data.chname[key]+"'>"+data.chname[key]+"</option>")
  140. }
  141. // 质量
  142. for (const key in data.quality) {
  143. // console.log('质量', key, data.quality[key]);
  144. $("select[name=quality]").append("<option class='qualityOption' value='"+key+"'>"+data.quality[key]+"</option>")
  145. }
  146. // 卡类型
  147. for (const key in data.card_type) {
  148. // console.log('类型', key, data.card_type[key]);
  149. $("select[name=card_type]").append("<option class='ctOption' value='"+key+"'>"+data.card_type[key]+"</option>")
  150. }
  151. // 面额
  152. for (const key in data.amount) {
  153. // console.log('面额', data.amount[key]);
  154. $("select[name=amount]").append("<option class='amountOption' value='"+data.amount[key]+"'>"+data.amount[key]+"</option>")
  155. }
  156. // console.log('data1', data);
  157. });
  158. })
  159. $('#ncsubmit').click(function () {
  160. let time_stamp = $("select[name=time_stamp]").val()
  161. let time_hour = $("select[name=time_hour]").val()
  162. let time = Number(time_stamp) + Number(time_hour)*3600
  163. // console.log('time',time_stamp,time_hour, time);
  164. let interval = $("select[name=interval]").val()
  165. let chname = $("select[name=chname]").val()
  166. let quality = $("select[name=quality]").val()
  167. let card_type = $("select[name=card_type]").val()
  168. let amount = $("select[name=amount]").val()
  169. if (!time_stamp) {
  170. layer.msg('请选择时间');
  171. return
  172. }
  173. let src = window.location.origin + "/plot/index?time_stamp=" + time + "&interval=" + interval + "&chname=" + chname + "&quality=" + quality + "&card_type=" + card_type + "&amount=" + amount
  174. if (!interval) {
  175. src = src.replace("&interval=", "")
  176. }
  177. if (!chname) {
  178. src = src.replace("&chname=", "")
  179. }
  180. if (!quality) {
  181. src = src.replace("&quality=", "")
  182. }
  183. if (!card_type) {
  184. src = src.replace("&card_type=", "")
  185. }
  186. if (!amount) {
  187. src = src.replace("&amount=", "")
  188. }
  189. $.get(src, function (data){
  190. if (!data) {
  191. return
  192. }
  193. $('iframe').attr('src',src)
  194. });
  195. });
  196. })
  197. </script>