index.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  4. <script src="{__PLUG_PATH}moment.js"></script>
  5. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  6. {/block}
  7. {block name="content"}
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox">
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline" id="dataFrom">
  15. <div class="search-item" data-name="date">
  16. <span>选择时间:</span>
  17. <button type="button" class="btn btn-outline btn-link" data-value="">全部</button>
  18. <button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.today}">今天</button>
  19. <button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.week}">本周</button>
  20. <button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.month}">本月</button>
  21. <button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.quarter}">本季度</button>
  22. <button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.year}">本年</button>
  23. <div class="datepicker" style="display: inline-block;">
  24. <button type="button" class="btn btn-outline btn-link" data-value="{$where.date?:'no'}">自定义时间</button>
  25. </div>
  26. <input class="search-item-value" type="hidden" name="date" value="{$where.date}" />
  27. </div>
  28. <select name="status" aria-controls="editable" class="form-control input-sm">
  29. <option value="">提现状态</option>
  30. <option value="-1" {eq name="where.status" value="-1"}selected="selected"{/eq}>未通过</option>
  31. <option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>未提现</option>
  32. <option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>已通过</option>
  33. </select>
  34. <select name="extract_type" class="form-control input-sm">
  35. <option value="">提现方式</option>
  36. <option value="alipay" {eq name="where.extract_type" value="alipay" }selected="selected"{/eq}>支付宝</option>
  37. <option value="bank" {eq name="where.extract_type" value="bank"}selected="selected"{/eq}>银行卡</option>
  38. <option value="weixin" {eq name="where.extract_type" value="weixin"}selected="selected"{/eq}>微信</option>
  39. </select>
  40. <div class="input-group">
  41. <span class="input-group-btn">
  42. <input type="text" name="nireid" value="{$where.nireid}" placeholder="微信昵称/姓名/支付宝账号/银行卡号" class="input-sm form-control" size="38"/>
  43. <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
  44. </span>
  45. </div>
  46. <button type="button" id="excel" class="btn btn-sm btn-primary"> 导出</button>
  47. </form>
  48. </div>
  49. <div class="col-sm-3 ui-sortable">
  50. <div class="ibox float-e-margins">
  51. <div class="ibox-title">
  52. <span class="label label-success pull-right">¥</span>
  53. <h5>已提现金额</h5>
  54. </div>
  55. <div class="ibox-content">
  56. <h1 class="no-margins">{$data.priced}</h1>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="col-sm-3 ui-sortable">
  61. <div class="ibox float-e-margins">
  62. <div class="ibox-title">
  63. <span class="label label-danger pull-right">急</span>
  64. <h5>待提现金额</h5>
  65. </div>
  66. <div class="ibox-content">
  67. <h1 class="no-margins">{$data.price}</h1>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="col-sm-3 ui-sortable">
  72. <div class="ibox float-e-margins">
  73. <div class="ibox-title">
  74. <span class="label label-success pull-right">待</span>
  75. <h5>佣金总金额</h5>
  76. </div>
  77. <div class="ibox-content">
  78. <h1 class="no-margins">{$data.brokerage_count}</h1>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="col-sm-3 ui-sortable">
  83. <div class="ibox float-e-margins">
  84. <div class="ibox-title">
  85. <span class="label label-success pull-right">待</span>
  86. <h5>未提现金额</h5>
  87. </div>
  88. <div class="ibox-content">
  89. <h1 class="no-margins">{$data.brokerage_not}</h1>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="table-responsive">
  95. <table class="table table-striped table-bordered">
  96. <thead>
  97. <tr>
  98. <th class="text-center">编号</th>
  99. <th class="text-center">用户信息</th>
  100. <th class="text-center">提现金额</th>
  101. <th class="text-center">提现方式</th>
  102. <th class="text-center">添加时间</th>
  103. <th class="text-center">备注</th>
  104. <th class="text-center">审核状态</th>
  105. <th class="text-center">操作</th>
  106. </tr>
  107. </thead>
  108. <tbody class="">
  109. {volist name="list" id="vo"}
  110. <tr>
  111. <td class="text-center">
  112. {$vo.id}
  113. </td>
  114. <td class="text-center">
  115. 用户昵称: {$vo.nickname}/用户id:{$vo.uid}
  116. </td>
  117. <td class="text-center" style="color: #00aa00;">
  118. {$vo.extract_price}
  119. </td>
  120. <td class="text-left">
  121. {if condition="$vo['extract_type'] eq 'bank'"}
  122. 姓名:{$vo.real_name}<br>
  123. 银行卡号:{$vo.bank_code}
  124. <br/>
  125. 银行开户地址:{$vo.bank_address}
  126. {elseif condition="$vo['extract_type'] eq 'weixin'"/}
  127. 昵称:{$vo.nickname}<br>
  128. 微信号:{$vo.wechat}
  129. {else/}
  130. 姓名:{$vo.real_name}<br>
  131. 支付宝号:{$vo.alipay_code}
  132. {/if}
  133. </td>
  134. <td class="text-center">
  135. {$vo.add_time|date='Y-m-d H:i:s'}
  136. </td>
  137. <td class="text-center">
  138. {$vo.mark}
  139. </td>
  140. <td class="text-center">
  141. {if condition="$vo['status'] eq 1"}
  142. 提现通过<br/>
  143. {elseif condition="$vo['status'] eq -1"/}
  144. 提现未通过<br/>
  145. 未通过原因:{$vo.fail_msg}
  146. <br>
  147. 未通过时间:{$vo.fail_time|date='Y-m-d H:i:s'}
  148. {else/}
  149. 未提现<br/>
  150. <button data-url="{:url('fail',['id'=>$vo['id']])}" class="j-fail btn btn-danger btn-xs" type="button"><i class="fa fa-close"></i> 无效</button>
  151. <button data-url="{:url('succ',['id'=>$vo['id']])}" class="j-success btn btn-primary btn-xs" type="button"><i class="fa fa-check"></i> 通过</button>
  152. {/if}
  153. </td>
  154. <td class="text-center">
  155. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  156. </td>
  157. </tr>
  158. {/volist}
  159. </tbody>
  160. </table>
  161. </div>
  162. {include file="public/inner_page"}
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. {/block}
  168. {block name="script"}
  169. <script>
  170. $(function init() {
  171. $('.search-item>.btn').on('click', function () {
  172. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = p.parents();
  173. form.find('input[name="' + name + '"]').val(value);
  174. $('input[name=export]').val(0);
  175. form.submit();
  176. });
  177. $('.tag-item>.btn').on('click', function () {
  178. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = p.parents(),list = $('input[name="' + name + '"]').val().split(',');
  179. var bool = 0;
  180. $.each(list,function (index,item) {
  181. if(item == value){
  182. bool = 1
  183. list.splice(index,1);
  184. }
  185. })
  186. if(!bool) list.push(''+value+'');
  187. form.find('input[name="' + name + '"]').val(list.join(','));
  188. $('input[name=export]').val(0);
  189. form.submit();
  190. });
  191. $('.search-item>li').on('click', function () {
  192. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = $('#form');
  193. form.find('input[name="' + name + '"]').val(value);
  194. $('input[name=export]').val(0);
  195. form.submit();
  196. });
  197. $('.search-item>li').each(function () {
  198. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name');
  199. if($where[name]) $('.'+name).css('color','#1ab394');
  200. });
  201. $('.search-item-value').each(function () {
  202. var that = $(this), name = that.attr('name'), value = that.val(), dom = $('.search-item[data-name="' + name + '"] .btn[data-value="' + value + '"]');
  203. dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary btn-sm')
  204. .siblings().addClass('btn-outline btn-link').removeClass('btn-primary btn-sm')
  205. });
  206. })
  207. $('.j-fail').on('click',function(){
  208. var url = $(this).data('url');
  209. $eb.$alert('textarea',{
  210. title:'请输入未通过原因',
  211. value:'输入信息不完整或有误!',
  212. },function(value){
  213. $eb.axios.post(url,{message:value}).then(function(res){
  214. if(res.data.code == 200) {
  215. $eb.$swal('success', res.data.msg);
  216. setTimeout(function () {
  217. window.location.reload();
  218. },1000);
  219. }else
  220. $eb.$swal('error',res.data.msg||'操作失败!');
  221. });
  222. });
  223. });
  224. $('#excel').on('click',function(){
  225. var data = $('#dataFrom').serializeArray();
  226. var url = '{:url('excel')}?date='+data[0].value+'&status='+data[1].value+'&extract_type='+data[2].value+'&nireid='+data[3].value;
  227. window.location.replace(url);
  228. });
  229. $('.j-success').on('click',function(){
  230. var url = $(this).data('url');
  231. $eb.$swal('delete',function(){
  232. $eb.axios.post(url).then(function(res){
  233. if(res.data.code == 200) {
  234. setTimeout(function () {
  235. window.location.reload();
  236. },1000);
  237. $eb.$swal('success', res.data.msg);
  238. }else
  239. $eb.$swal('error',res.data.msg||'操作失败!');
  240. });
  241. },{
  242. title:'确定审核通过?',
  243. text:'通过后无法撤销,请谨慎操作!',
  244. confirm:'审核通过'
  245. });
  246. });
  247. $('.btn-warning').on('click',function(){
  248. window.t = $(this);
  249. var _this = $(this),url =_this.data('url');
  250. $eb.$swal('delete',function(){
  251. $eb.axios.get(url).then(function(res){
  252. if(res.status == 200 && res.data.code == 200) {
  253. $eb.$swal('success',res.data.msg);
  254. _this.parents('tr').remove();
  255. }else
  256. return Promise.reject(res.data.msg || '删除失败')
  257. }).catch(function(err){
  258. $eb.$swal('error',err);
  259. });
  260. })
  261. });
  262. $(".open_image").on('click',function (e) {
  263. var image = $(this).data('image');
  264. $eb.openImage(image);
  265. })
  266. var dateInput = $('.datepicker');
  267. dateInput.daterangepicker({
  268. autoUpdateInput: false,
  269. "opens": "center",
  270. "drops": "down",
  271. "ranges": {
  272. '今天': [moment(), moment().add(1, 'days')],
  273. '昨天': [moment().subtract(1, 'days'), moment()],
  274. '上周': [moment().subtract(6, 'days'), moment()],
  275. '前30天': [moment().subtract(29, 'days'), moment()],
  276. '本月': [moment().startOf('month'), moment().endOf('month')],
  277. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  278. },
  279. "locale" : {
  280. applyLabel : '确定',
  281. cancelLabel : '取消',
  282. fromLabel : '起始时间',
  283. toLabel : '结束时间',
  284. format : 'YYYY/MM/DD',
  285. customRangeLabel : '自定义',
  286. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  287. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  288. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  289. firstDay : 1
  290. }
  291. });
  292. dateInput.on('apply.daterangepicker', function(ev, picker) {
  293. $("input[name=date]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  294. $('form').submit();
  295. });
  296. </script>
  297. {/block}