index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. use yii\helpers\Html;
  5. use yii\helpers\Url;
  6. ?>
  7. <div class="row wrapper border-bottom white-bg page-heading">
  8. <div class="col-lg-12">
  9. <h2>入金管理</h2>
  10. <ol class="breadcrumb">
  11. <li>
  12. <a href="/admin/dashboard">管理首页</a>
  13. </li>
  14. <li class="active">
  15. <strong>入金管理</strong>
  16. </li>
  17. </ol>
  18. </div>
  19. </div>
  20. <div class="wrapper wrapper-content animated fadeInRight">
  21. <!--
  22. <div class="row">
  23. <div class="col-lg-6">
  24. <div class="widget style1 red-bg">
  25. <div class="row">
  26. <div class="col-xs-4">
  27. <i class="fa fa-cny fa-5x"></i>
  28. </div>
  29. <div class="col-xs-8 text-right">
  30. <span> 待入金 </span>
  31. <h2 class="font-bold">${sum0?string(",##0.00#")}</h2>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="col-lg-6">
  37. <div class="widget style1 navy-bg">
  38. <div class="row">
  39. <div class="col-xs-4">
  40. <i class="fa fa-cny fa-5x"></i>
  41. </div>
  42. <div class="col-xs-8 text-right">
  43. <span> 成功入金 </span>
  44. <h2 class="font-bold">${sum1?string(",##0.00#")}</h2>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. -->
  51. <form>
  52. <input type="hidden" name="type" value="<?= $type ?>">
  53. <div class="ibox-content m-b-sm border-bottom">
  54. <div class="row">
  55. <div class="col-sm-3">
  56. <div class="form-group">
  57. <label class="control-label">客户姓名</label>
  58. <input type="text" id="name" name="name" value="<?= Yii::$app->getRequest()->get('name') ?>" placeholder="客户姓名" class="form-control">
  59. </div>
  60. </div>
  61. <div class="col-sm-3">
  62. <div class="form-group">
  63. <label class="control-label" for="price">开始时间</label>
  64. <input readonly="readonly" type="text" id="sTime" name="sTime" value="<?= Yii::$app->getRequest()->get('sTime') ?>" placeholder="开始时间" class="datetime form-control">
  65. </div>
  66. </div>
  67. <div class="col-sm-3">
  68. <div class="form-group">
  69. <label class="control-label" for="quantity">结束时间</label>
  70. <input readonly="readonly" type="text" id="eTime" name="eTime" value="<?= Yii::$app->getRequest()->get('eTime') ?>" placeholder="结束时间" class="datetime form-control">
  71. </div>
  72. </div>
  73. <div class="col-sm-3">
  74. <div class="form-group">
  75. <label class="control-label" for="quantity">操作</label>
  76. <input type="submit" class="btn btn-primary form-control" value="搜索">
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </form>
  82. <div class="row">
  83. <div class="col-lg-12">
  84. <div class="ibox float-e-margins">
  85. <div class="ibox-title">
  86. <h5 style="line-height:30px;">
  87. <?php if ($type == 0) : ?>待入金<?php elseif ($type == 1): ?>成功入金<?php endif; ?>明细
  88. </h5>
  89. <?php if($type == 0) :?>
  90. <div class="btn-group pull-right">
  91. <button id="patchIntoGold" class="btn btn-primary">补单</button>
  92. </div>
  93. <?php endif;?>
  94. <?php if ($type == 1): ?>
  95. <div class="btn-group pull-right" style="margin-right: 10px;">
  96. <button id="RevokeIntoGold" class="btn btn-primary">撤销入金</button>
  97. </div>
  98. <?php endif; ?>
  99. <div class="clearfix"></div>
  100. </div>
  101. <div class="ibox-content">
  102. <div class="table-responsive">
  103. <table id="datatables" class="table table-striped table-bordered table-hover">
  104. <thead>
  105. <tr>
  106. <th>编号</th>
  107. <th>状态</th>
  108. <th>代理商</th>
  109. <th>账户</th>
  110. <th>姓名</th>
  111. <th>手机</th>
  112. <th>金额</th>
  113. <th>人民币</th>
  114. <th>港币</th>
  115. <th>汇率</th>
  116. <th>入金方式</th>
  117. <th>MT4入金状态</th>
  118. <th>支付单号</th>
  119. <th>入金时间</th>
  120. <th>操作人</th>
  121. <th>MT4订单号码</th>
  122. </tr>
  123. </thead>
  124. <tfoot>
  125. <tr>
  126. <th>编号</th>
  127. <th>状态</th>
  128. <th>代理商</th>
  129. <th>账户</th>
  130. <th>姓名</th>
  131. <th>手机</th>
  132. <th>金额</th>
  133. <th>人民币</th>
  134. <th>港币</th>
  135. <th>汇率</th>
  136. <th>入金方式</th>
  137. <th>MT4入金状态</th>
  138. <th>支付单号</th>
  139. <th>入金时间</th>
  140. <th>操作人</th>
  141. <th>MT4订单号码</th>
  142. </tr>
  143. </tfoot>
  144. </table>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. <?php $this->beginBlock('footer_script');?>
  152. <script>
  153. KindEditor.ready(function (K) {
  154. });
  155. </script>
  156. <!-- Page-Level Scripts -->
  157. <script>
  158. var table;
  159. $(document).ready(function () {
  160. table = $('#datatables').DataTable({
  161. "aLengthMenu": [[20, 50, 100, 500, 999999999], [20, 50, 100, 500, "ALL"]],
  162. language: {
  163. "sProcessing": "处理中...",
  164. "sLengthMenu": "显示 _MENU_ 项结果",
  165. "sZeroRecords": "没有匹配结果",
  166. "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
  167. "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
  168. "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
  169. "sInfoPostFix": "",
  170. "sSearch": "搜索:",
  171. "sUrl": "",
  172. "sEmptyTable": "表中数据为空",
  173. "sLoadingRecords": "载入中...",
  174. "sInfoThousands": ",",
  175. "oPaginate": {
  176. "sFirst": "首页",
  177. "sPrevious": "上页",
  178. "sNext": "下页",
  179. "sLast": "末页"
  180. },
  181. "oAria": {
  182. "sSortAscending": ": 以升序排列此列",
  183. "sSortDescending": ": 以降序排列此列"
  184. }
  185. },
  186. "processing": true,
  187. "serverSide": true,
  188. "ajax": '<?= Url::to(['ajax', 'type' => $type, 'name'=>Yii::$app->getRequest()->get('name'), 'sTime' => Yii::$app->getRequest()->get('sTime'), 'eTime' => Yii::$app->getRequest()->get('eTime')]) ?>',
  189. "order": [[0, "desc"]],
  190. "columns": [{
  191. "data": "id"
  192. }, {
  193. "data": "type"
  194. }, {
  195. "data": "IBNAME"
  196. }, {
  197. "data": "login"
  198. }, {
  199. "data": "name"
  200. }, {
  201. "data": "mobile"
  202. }, {
  203. "data": "amount"
  204. }, {
  205. "data": "rmb"
  206. }, {
  207. "data": "rmb"
  208. }, {
  209. "data": "rate"
  210. }, {
  211. "data": "pay_name"
  212. }, {
  213. "data": "mt4_status"
  214. }, {
  215. "data": "order_sn"
  216. }, {
  217. "data": "in_time"
  218. }, {
  219. "data": "admin_name"
  220. },{
  221. "data": "mt4_order_id"
  222. }],
  223. columnDefs: [{
  224. targets: 1,
  225. render: function (data, type, row, meta) {
  226. if (data == 0) {
  227. return '<span class="label label-danger">等待</span>';
  228. } else if (data == 1) {
  229. return '<span class="label label-primary">成功</span>';
  230. }else if(data==2){
  231. return '<span class="label label-warning">创建中</span>'
  232. }
  233. },
  234. "orderable": true
  235. }, {
  236. targets: 7,
  237. render: function (data, type, row, meta) {
  238. if(row.pay_name=="银联支付A" || row.pay_name=="银联支付B" || row.pay_name=="银联支付C" || row.pay_name=="捷登支付A" || row.pay_name=="JD通道A" ){
  239. return 0.00
  240. }else{
  241. return data;
  242. }
  243. },
  244. "orderable": true
  245. },
  246. {
  247. targets: 8,
  248. render: function (data, type, row, meta) {
  249. if(row.pay_name=="银联支付A" || row.pay_name=="银联支付B" || row.pay_name=="银联支付C" || row.pay_name=="捷登支付A" || row.pay_name=="JD通道A"){
  250. return data;
  251. }else{
  252. return 0.00;
  253. }
  254. },
  255. "orderable": true
  256. },
  257. {
  258. targets: 13,
  259. render: function (data, type, row, meta) {
  260. return timeStamp2String(data);
  261. },
  262. "orderable": true
  263. }, {
  264. targets: 11,
  265. render: function (data, type, row, meta) {
  266. if (data == 0) {
  267. return '<span class="label label-danger">未入金</span>';
  268. } else if (data == 1) {
  269. return '<span class="label label-primary">已入金</span>';
  270. }
  271. },
  272. "orderable": true
  273. }],
  274. "sPaginationType": "full_numbers",
  275. dom: '<"html5buttons"B>lTfgitp',
  276. buttons: [{
  277. extend: 'copy'
  278. },
  279. {
  280. extend: 'csv'
  281. },
  282. {
  283. extend: 'excel'
  284. },
  285. {
  286. extend: 'pdf'
  287. },
  288. {
  289. extend: 'print',
  290. customize: function (win) {
  291. $(win.document.body).addClass('white-bg');
  292. $(win.document.body).css('font-size', '10px');
  293. $(win.document.body).find('table').addClass('compact').css('font-size', 'inherit');
  294. }
  295. }]
  296. });
  297. $('#datatables tbody').on('click', 'tr',
  298. function () {
  299. if ($(this).hasClass('selected')) {
  300. $(this).removeClass('selected');
  301. } else {
  302. table.$('tr.selected').removeClass('selected');
  303. $(this).addClass('selected');
  304. }
  305. });
  306. $("#modal").on("hidden.bs.modal", function () {
  307. $(this).removeData("bs.modal");
  308. KindEditor.remove('#kindeditor');
  309. });
  310. $('.data').datepicker({
  311. startView: 1,
  312. todayBtn: "linked",
  313. keyboardNavigation: true,
  314. forceParse: false,
  315. autoclose: true,
  316. format: "yyyy-mm-dd"
  317. });
  318. });
  319. $('#patchIntoGold').click(function () {
  320. var data = table.row('.selected').data();
  321. if (data != undefined) {
  322. swal({
  323. title: "您确定吗?",
  324. text: "请确定已收到客户款项!",
  325. type: "warning",
  326. showCancelButton: true,
  327. confirmButtonColor: "#DD6B55",
  328. confirmButtonText: "确定",
  329. cancelButtonText: "取消",
  330. closeOnConfirm: true
  331. }, function (isConfirm) {
  332. if (isConfirm) {
  333. $.ajax({
  334. type: "POST",
  335. url: "<?= Url::to(['patch-into-gold']) ?>",
  336. data: {
  337. id: data.id
  338. },
  339. dataType: "json",
  340. beforeSend: function () {
  341. },
  342. success: function (data) {
  343. if (data.isSuccess) {
  344. table.ajax.reload();
  345. } else {
  346. toastr.error(data.msg, "提示");
  347. }
  348. },
  349. complete: function (XMLHttpRequest, textStatus) {
  350. },
  351. error: function () {
  352. }
  353. });
  354. }
  355. });
  356. }
  357. });
  358. // 撤销入金的操作
  359. $('#RevokeIntoGold').click(function () {
  360. var data = table.row('.selected').data();
  361. if (data != undefined) {
  362. swal({
  363. title: "您确定吗?",
  364. text: "确定撤销此订单",
  365. type: "warning",
  366. showCancelButton: true,
  367. confirmButtonColor: "#DD6B55",
  368. confirmButtonText: "确定",
  369. cancelButtonText: "取消",
  370. closeOnConfirm: true
  371. }, function (isConfirm) {
  372. if (isConfirm) {
  373. $.ajax({
  374. type: "POST",
  375. url: "<?= Url::to(['revokegold']) ?>",
  376. data: {
  377. id: data.id,
  378. mt4_order_id:data.mt4_order_id
  379. },
  380. dataType: "json",
  381. beforeSend: function () {
  382. },
  383. success: function (data) {
  384. if (data.isSuccess) {
  385. toastr.success(data.msg,'提示');
  386. table.ajax.reload();
  387. } else {
  388. toastr.error(data.msg, "提示");
  389. }
  390. },
  391. complete: function (XMLHttpRequest, textStatus) {
  392. },
  393. error: function () {
  394. }
  395. });
  396. }
  397. });
  398. }
  399. });
  400. </script>
  401. <?php $this->endBlock();?>