merchant.ctl.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. <style>
  2. .mleft {
  3. margin-left: 45px;
  4. }
  5. hr {
  6. border: none;
  7. border-top: 1px solid #cbe9f3;
  8. margin-bottom: 10px;
  9. margin-top: 10px;
  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. </style>
  20. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  21. <div class="page">
  22. <div class="fixed-bar">
  23. <div class="item-title">
  24. <h3><?php echo $lang['nc_merchant'] ?></h3>
  25. <ul class="tab-base">
  26. <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
  27. <li><a href="JavaScript:void(0);" class="current"><span>充值设置</span></a></li>
  28. </ul>
  29. </div>
  30. </div>
  31. <div class="fixed-empty"></div>
  32. <form id="user_form" enctype="multipart/form-data" method="post">
  33. <input type="hidden" name="form_submit" value="ok"/>
  34. <input type="hidden" name="mchid" value="<?php echo $output['merchant']['mchid']; ?>"/>
  35. <table class="table tb-type2">
  36. <tbody>
  37. <tr class="noborder">
  38. <td colspan="2" class="required"><label class="validation">机构名称:</label></td>
  39. </tr>
  40. <tr class="noborder">
  41. <td class="mleft"
  42. style="display: block"><?php echo "{$output['merchant']['mchid']} :{$output['merchant']['company_name']}"; ?></td>
  43. </tr>
  44. <tr class="noborder">
  45. <td colspan="2" class="required"><label class="validation">拦截设置:</label></td>
  46. </tr>
  47. <tr class="noborder">
  48. <td colspan="2" class="required mleft"><label style="display: inline-block;width: 46px;" class="mleft" for="name">转网:</label>
  49. <label>
  50. <input type="radio" name="is_transfer"
  51. value="1" <?php if ($output['intercept']['is_transfer'] === true) {
  52. echo 'checked';
  53. } ?>>
  54. </label>是
  55. <label>
  56. <input type="radio" name="is_transfer"
  57. value="0" <?php if ($output['intercept']['is_transfer'] === false) {
  58. echo 'checked';
  59. } ?>>
  60. </label>否
  61. </td>
  62. </tr>
  63. <tr class="noborder">
  64. <td colspan="2" class="required"><label class="mleft" for="name">状态码:</label>
  65. <?php foreach ($output['card_state'] as $key => $value) { ?>
  66. <?php if (!in_array($value, ['空号', '实号', '风险号']) && !in_array($key, [0, 1, 5])) { ?>
  67. <label>
  68. <input type="checkbox" name="card_states[]" value="<?php echo $key; ?>"
  69. <?php if (!empty($output['intercept']['card_states']) && in_array($key, $output['intercept']['card_states'])) {
  70. echo 'checked';
  71. } ?>
  72. >
  73. </label><?php echo $value; ?>
  74. <?php } ?>
  75. <?php } ?>
  76. </td>
  77. </tr>
  78. <tr class="noborder">
  79. <td colspan="2" class="required"><label class="mleft" style="margin-right: 12px;" for="name">三网:</label>
  80. <label>
  81. <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaMobileCard; ?>"
  82. <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaMobileCard, $output['intercept']['card_types'])) {
  83. echo 'checked';
  84. } ?>>
  85. </label>移动
  86. <label>
  87. <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaUnicomCard; ?>"
  88. <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaUnicomCard, $output['intercept']['card_types'])) {
  89. echo 'checked';
  90. } ?>>
  91. </label>联通
  92. <label>
  93. <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaTelecomCard; ?>"
  94. <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaTelecomCard, $output['intercept']['card_types'])) {
  95. echo 'checked';
  96. } ?>>
  97. </label>电信
  98. </td>
  99. </tr>
  100. <tr class="noborder">
  101. <td>
  102. <hr>
  103. </td>
  104. </tr>
  105. <tr class="noborder">
  106. <td colspan="2" class="required"><label class="validation">高价补充条件:</label></td>
  107. </tr>
  108. <tr class="noborder">
  109. <td colspan="2" class="required"><label style="margin-left: 45px; " for="name">成功率不低于:</label>
  110. <label for="success"></label><input type="text" name="ratio"
  111. value="<?php echo $output['retry_times']['lower_ratio']['ratio'] ?? 0; ?>" id="success">
  112. <label style="margin-left: 15px;" for="name">检测时间:</label>
  113. <label>
  114. <select name="period">
  115. <option value="3600" <?php if ($output['retry_times']['lower_ratio']['period'] == 3600) {
  116. echo 'selected';
  117. } ?>>3600
  118. <option value="86400" <?php if ($output['retry_times']['lower_ratio']['period'] == 86400) {
  119. echo 'selected';
  120. } ?>>当天
  121. </option>
  122. <option value="7200" <?php if ($output['retry_times']['lower_ratio']['period'] == 7200) {
  123. echo 'selected';
  124. } ?>>7200
  125. </option>
  126. <option value="1800" <?php if ($output['retry_times']['lower_ratio']['period'] == 1800) {
  127. echo 'selected';
  128. } ?>>1800
  129. </option>
  130. <option value="900" <?php if ($output['retry_times']['lower_ratio']['period'] == 900) {
  131. echo 'selected';
  132. } ?>>900
  133. </option>
  134. </select>
  135. </label>
  136. <label for="name">( 秒 )</label>
  137. </td>
  138. </tr>
  139. <tr class="noborder">
  140. <td colspan="2" class="required"><label style="margin-left: 45px;display: inline-block;width: 84px" for="name">利润率低于:</label>
  141. <label>
  142. <input id="profit_ratio" type="text" name="profit_ratio"
  143. value="<?php echo $output['retry_times']['profit_ratio'] ?? 0;?>"
  144. >
  145. </label>
  146. <label style="margin-left: 15px;" for="name">时自动不补充</label>
  147. </td>
  148. </tr>
  149. <tr class="noborder">
  150. <td>
  151. <hr>
  152. </td>
  153. </tr>
  154. <tr class="noborder">
  155. <td colspan="2" class="required"><label class="validation">充值时间和次数设置:</label>
  156. <div style="margin-left:149px;">
  157. <label style="display: inline-block;">白天秒数</label>
  158. <label style="display: inline-block; margin: 0 145px 0 148px;">黑天秒数</label>
  159. <label style="display: inline-block;">重试次数</label>
  160. </div>
  161. </td>
  162. </tr>
  163. <?php foreach ($output['quality'] as $key => $value) { ?>
  164. <tr class="noborder">
  165. <td colspan="2" class="required judge">
  166. <label class="seconds"
  167. style="margin-left: 48px;display:inline-block; margin-right: 16px; min-width: 38px"
  168. for="name"><?php echo $value; ?>:</label>
  169. <label>
  170. <input class="day_secs" type="text" name="<?php echo "$key-day_secs"; ?>"
  171. value="<?php echo $output['retry_times']['qualities'][$key]['day_secs'] ?? 0; ?>">
  172. </label>
  173. <label>
  174. <input class="night_secs" style="margin: 0 30px;" type="text" name="<?php echo "$key-night_secs"; ?>"
  175. value="<?php echo $output['retry_times']['qualities'][$key]['night_secs'] ?? 0; ?>">
  176. </label>
  177. <label>
  178. <input class="times" type="text" name="<?php echo "$key-times"; ?>"
  179. value="<?php echo $output['retry_times']['qualities'][$key]['times'] ?? 0; ?>">
  180. </label>
  181. </td>
  182. </tr>
  183. <?php } ?>
  184. <tr>
  185. <td colspan="2" class="required"><label class="validation" for="oil_quality">油卡通道质量:</label></td>
  186. </tr>
  187. <tr class="noborder">
  188. <td class="vatop" style="display: block; margin-left: 43px;">
  189. <label>
  190. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::Normal) {
  191. echo 'checked';
  192. } ?> value="<?php echo refill\Quality::Normal; ?>" type="radio">
  193. </label>无流水
  194. <label>
  195. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::SlowTwentyFour) {
  196. echo 'checked';
  197. } ?> value="<?php echo refill\Quality::SlowTwentyFour; ?>" type="radio">
  198. </label>有流水
  199. <label>
  200. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::CardKey) {
  201. echo 'checked';
  202. } ?> value="<?php echo refill\Quality::CardKey; ?>" type="radio">
  203. </label>卡密
  204. <label>
  205. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::Quick) {
  206. echo 'checked';
  207. } ?> value="<?php echo refill\Quality::Quick; ?>" type="radio">
  208. </label>快充
  209. <label>
  210. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OilSN_NONE_HAS) {
  211. echo 'checked';
  212. } ?> value="<?php echo refill\Quality::OilSN_NONE_HAS; ?>" type="radio">
  213. </label>无流水+有流水
  214. <label>
  215. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OilSN_HAS_NONE) {
  216. echo 'checked';
  217. } ?> value="<?php echo refill\Quality::OilSN_HAS_NONE; ?>" type="radio">
  218. </label>有流水+无流水
  219. <label>
  220. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_CARDKEY) {
  221. echo 'checked';
  222. } ?> value="<?php echo refill\Quality::OIL_SN_CARDKEY; ?>" type="radio">
  223. </label>有流水+卡密
  224. <label>
  225. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_CARDKEY) {
  226. echo 'checked';
  227. } ?> value="<?php echo refill\Quality::OIL_SNNONE_CARDKEY; ?>" type="radio">
  228. </label>无流水+卡密
  229. <label>
  230. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_SNNONE_CARDKEY) {
  231. echo 'checked';
  232. } ?> value="<?php echo refill\Quality::OIL_SN_SNNONE_CARDKEY; ?>" type="radio">
  233. </label>有流水+无流水+卡密
  234. <label>
  235. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY) {
  236. echo 'checked';
  237. } ?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY; ?>" type="radio">
  238. </label>无流水+有流水+卡密
  239. <label>
  240. <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK) {
  241. echo 'checked';
  242. } ?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK; ?>" type="radio">
  243. </label>无流水+有流水+卡密+快充
  244. </td>
  245. </tr>
  246. <tr>
  247. <td colspan="2" class="required"><label class="validation" for="quality">话费通道质量:</label></td>
  248. </tr>
  249. <tr class="noborder">
  250. <td class="vatop" style="display: block; margin-left: 43px;">
  251. <label>
  252. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Normal) {
  253. echo 'checked';
  254. } ?> value="<?php echo refill\Quality::Normal; ?>" type="radio">
  255. </label>普通
  256. <label>
  257. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Quick) {
  258. echo 'checked';
  259. } ?> value="<?php echo refill\Quality::Quick; ?>" type="radio">
  260. </label>快速
  261. <label>
  262. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::CardKey) {
  263. echo 'checked';
  264. } ?> value="<?php echo refill\Quality::CardKey; ?>" type="radio">
  265. </label>卡密
  266. <label>
  267. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdShop) {
  268. echo 'checked';
  269. } ?> value="<?php echo refill\Quality::ThirdShop; ?>" type="radio">
  270. </label>三方
  271. <label>
  272. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowTwentyFour) {
  273. echo 'checked';
  274. } ?> value="<?php echo refill\Quality::SlowTwentyFour; ?>" type="radio">
  275. </label>慢24
  276. <label>
  277. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSix) {
  278. echo 'checked';
  279. } ?> value="<?php echo refill\Quality::SlowSix; ?>" type="radio">
  280. </label>慢6
  281. <label>
  282. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowTwo) {
  283. echo 'checked';
  284. } ?> value="<?php echo refill\Quality::SlowTwo; ?>" type="radio">
  285. </label>慢2
  286. <label>
  287. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowFortyEight) {
  288. echo 'checked';
  289. } ?> value="<?php echo refill\Quality::SlowFortyEight; ?>" type="radio">
  290. </label>慢48
  291. <label>
  292. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSeventyTwo) {
  293. echo 'checked';
  294. } ?> value="<?php echo refill\Quality::SlowSeventyTwo; ?>" type="radio">
  295. </label>慢72
  296. <label>
  297. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Fastest) {
  298. echo 'checked';
  299. } ?> value="<?php echo refill\Quality::Fastest; ?>" type="radio">
  300. </label>速充
  301. <label>
  302. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowNormal) {
  303. echo 'checked';
  304. } ?> value="<?php echo refill\Quality::SlowNormal; ?>" type="radio">
  305. </label>慢充一次+普充
  306. <label>
  307. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdNormal) {
  308. echo 'checked';
  309. } ?> value="<?php echo refill\Quality::ThirdNormal; ?>" type="radio">
  310. </label>三方一次+普充
  311. <label>
  312. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::DefSuccess) {
  313. echo 'checked';
  314. } ?> value="<?php echo refill\Quality::DefSuccess; ?>" type="radio">
  315. </label>普充+卡密+快充
  316. <label>
  317. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::NormalQuick) {
  318. echo 'checked';
  319. } ?> value="<?php echo refill\Quality::NormalQuick; ?>" type="radio">
  320. </label>普充+快充
  321. <label>
  322. <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSixNormal) {
  323. echo 'checked';
  324. } ?> value="<?php echo refill\Quality::SlowSixNormal; ?>" type="radio">
  325. </label>慢充6+普充
  326. </td>
  327. </tr>
  328. </tbody>
  329. <tfoot>
  330. <tr class="tfoot">
  331. <td colspan="15"><a href="JavaScript:void(0);" class="btn"
  332. id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
  333. </tr>
  334. </tfoot>
  335. </table>
  336. </form>
  337. </div>
  338. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
  339. charset="utf-8"></script>
  340. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  341. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
  342. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
  343. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  344. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  345. <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
  346. id="cssfile2"/>
  347. <script type="text/javascript">
  348. $(function () {
  349. //按钮先执行验证再提交表单
  350. let day
  351. let nights
  352. let times
  353. $("#submitBtn").click(function () {
  354. if (day == 0 || nights == 0 || times == 0) {
  355. layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置)');
  356. } else {
  357. $("#user_form").submit();
  358. }
  359. })
  360. $('.required .day_secs').each(function(index, item) {
  361. $(item).change(function() {
  362. const day_secs = $(this).val()
  363. const zero = day_secs.replace(/^[0]+/,'')
  364. const zero_day = day_secs.substr(0, 1)
  365. const zero_length = day_secs.substr(day_secs.length -1)
  366. if (zero_day == 0) {
  367. $(this).val(zero_day);
  368. }
  369. if (zero_length != 0){
  370. console.log(zero, 123);
  371. $(item).val(zero);
  372. }
  373. if ((!/^\d+$/.test(day_secs)) || isNaN(day_secs)) {
  374. layer.msg('白天秒数只能设置大于0的整数');
  375. $(item).val("0");
  376. }
  377. })
  378. })
  379. $('.required .night_secs').each(function(index, item) {
  380. $(item).change(function() {
  381. const night_secs = $(this).val()
  382. const zero = night_secs.replace(/^[0]+/,'')
  383. const zero_day = night_secs.substr(0, 1)
  384. const zero_length = night_secs.substr(night_secs.length -1)
  385. if (zero_day == 0) {
  386. $(this).val(zero_day);
  387. }
  388. if (zero_length != 0){
  389. $(item).val(zero);
  390. }
  391. if ((!/^\d+$/.test(night_secs)) || isNaN(night_secs)) {
  392. layer.msg('黑天秒数只能设置大于0的整数');
  393. $(item).val("0");
  394. }
  395. })
  396. })
  397. $('.required .times').each(function(index, item) {
  398. $(item).change(function() {
  399. const times = $(this).val()
  400. const zero = times.replace(/^[0]+/,'')
  401. const zero_day = times.substr(0, 1)
  402. const zero_length = times.substr(times.length -1)
  403. if (zero_day == 0) {
  404. $(this).val(zero_day);
  405. }
  406. if (zero_length != 0){
  407. $(item).val(zero);
  408. }
  409. if ((!/^\d+$/.test(times)) || isNaN(times)) {
  410. layer.msg('重试次数只能设置大于0的整数');
  411. $(item).val("0");
  412. }
  413. })
  414. })
  415. $('#success').change(function(index, item) {
  416. const success = $(this).val()
  417. const intercept = success.substring(success.length, success.length-1)
  418. if(intercept == '.') {
  419. layer.msg('成功率只能设置浮点数');
  420. $(this).val("0.00");
  421. return
  422. }
  423. const zero = success.replace(/^0+\./g, '0.')
  424. $(this).val(zero);
  425. if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(success)) || isNaN(success)){
  426. layer.msg('成功率只能设置浮点数');
  427. $(this).val("0.00");
  428. }
  429. })
  430. $('#profit_ratio').change(function(index, item) {
  431. const profit_ratio = $(this).val()
  432. const intercept = profit_ratio.substring(profit_ratio.length, profit_ratio.length-1)
  433. if(intercept == '.') {
  434. layer.msg('利润率只能设置浮点数');
  435. $(this).val("0.00");
  436. return
  437. }
  438. const zero = profit_ratio.replace(/^0+\./g,'0.')
  439. $(this).val(zero);
  440. if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(profit_ratio)) || isNaN(profit_ratio)){
  441. layer.msg('利润率只能设置浮点数');
  442. $(this).val("0.00");
  443. }
  444. })
  445. $('.judge').each(function(index, item) {
  446. let day_secs = $(item).find('.day_secs').val()
  447. let night_secs = $(item).find('.night_secs').val()
  448. let times_secs = $(item).find('.times').val()
  449. $(item).change(function() {
  450. let day_secs = $(item).find('.day_secs').val()
  451. let night_secs = $(item).find('.night_secs').val()
  452. let times_secs = $(item).find('.times').val()
  453. day = day_secs
  454. nights = night_secs
  455. times = times_secs
  456. if (day_secs == 0 || night_secs == 0 || times_secs == 0) {
  457. layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置 只能设置大于0的整数)');
  458. }
  459. })
  460. })
  461. });
  462. </script>