wupengfei il y a 2 ans
Parent
commit
61cc826aea

+ 47 - 16
application/user/controller/Deposit.php

@@ -50,6 +50,7 @@ class Deposit extends Controller
         $sel_where = [];
         $sel_where[] = ['w.is_deleted','=',0];
         $this->dep_type = ['','微信','支付宝','银行卡'];
+        $this->sh_arr = ['待审核','审核通过','审核拒绝','打款成功','打款失败'];
         if($name = $this->request->get('name')) $sel_where[] =['m.name','like','%'.$name.'%'];
         if($phone = $this->request->get('phone')) $sel_where[] =['m.phone','like','%'.$phone.'%'];
         if($type = $this->request->get('type')){
@@ -57,9 +58,21 @@ class Deposit extends Controller
             if($type == 2)  $sel_where[] =['w.withdraw_type','=','zfb'];
             if($type == 3)  $sel_where[] =['w.withdraw_type','=','bank'];
         }
-        $sh_status = $this->request->get('sh_status',-1);
-        if($sh_status>= 0) {
-            $sel_where[] =['w.sh_status','=',$sh_status];
+        $sel_sh = input('sel_sh',-1);
+        $this->sel_sh = $sel_sh;
+        switch ($sel_sh) {
+            case 0 ;case 1 ; case 2:
+            $sel_where[] =['w.sh_status','=',$sel_sh];
+            break;
+            case 3:
+                $sel_where[] =['w.sh_status','=',2];
+                $sel_where[] =['w.is_over','=',1];
+                $sel_where[] =['w.paid','=',1];
+                break;
+            case 4:
+                $sel_where[] =['w.sh_status','=',1];
+                $sel_where[] =['w.paid','=',0];
+                break;
         }
         $query = $this->_query($this->table)->alias('w')
             ->where($sel_where)
@@ -79,7 +92,7 @@ class Deposit extends Controller
     protected function _index_page_filter(&$data)
     {
         foreach ($data as $k=>&$v){
-
+            $v['return_info'] = $v['return_info'] ? json_decode($v['return_info'],true):[];
         }
     }
 
@@ -134,8 +147,8 @@ class Deposit extends Controller
                             $Shande= new Shande();
                             $result = $Shande->payToCard($withdrawal['account_no'],$withdrawal['account_name'],$withdrawal['real_money'],$withdrawal['order_no'],'会员提现');
                             if(empty($result) || $result['respCode']!='0000'){//失败
-                                Db::name('store_member_withdraw')->where('id',$withdrawal['id'])->update(['return_info'=>json_encode($result,true)]);
-                                $this->error('提现失败');
+                                Db::name('store_member_withdraw')->where('id',$withdrawal['id'])->update(['return_info'=>json_encode($result,true),'order_no'=>get_order_sn()]);
+                                $this->error($result['respDesc']);
                             }else{
                                 Db::name('store_member_withdraw')->where('id',$withdrawal['id'])->update(['paid'=>1,'pay_time'=>time(),'is_over'=>1,'return_info'=>json_encode($result,true)]);
                             }
@@ -180,12 +193,23 @@ class Deposit extends Controller
         if($type = $this->request->get('type')){
             if($type == 1)  $sel_where[] =['w.withdraw_type','=','wx'];
             if($type == 2)  $sel_where[] =['w.withdraw_type','=','zfb'];
-            if($type == 3)  $sel_where[] =['w.withdraw_type','=','bank'];
         }
-        $sh_status = $this->request->get('sh_status',-1);
-        if($sh_status>= 0) {
-            $sel_where[] =['w.sh_status','=',$sh_status];
+        $sel_sh = input('sel_sh',-1);
+        switch ($sel_sh) {
+            case 0 ;case 1 ; case 2:
+            $sel_where[] =['w.sh_status','=',$sel_sh];
+            break;
+            case 3:
+                $sel_where[] =['w.sh_status','=',2];
+                $sel_where[] =['w.paid','=',1];
+                $sel_where[] =['w.is_over','=',1];
+                break;
+            case 4:
+                $sel_where[] =['w.sh_status','=',1];
+                $sel_where[] =['w.paid','=',0];
+                break;
         }
+
         $sel_time = input('create_at');
         if($sel_time) {
             $time_arr = explode(' - ',$sel_time);
@@ -205,17 +229,24 @@ class Deposit extends Controller
                 $item['sh_status'] = $sh_dsec[$item['sh_status']];
                 $item['paid'] = $item['paid'] == 1 ? '是':'否';
                 $export[] = [
-                    $item['id'],
-                    $item['account_name'],
-                    $item['account_no'],
+                    $item['m_name'],
+                    $item['phone'],
+                    $item['order_no'],
+                    $item['price'],
+                    $item['proportion'],
                     $item['real_money'],
+                    $item['paid'],
+                    $item['create_at'],
+                    $item['sh_time'],
+                    $item['sh_status'],
                     $item['sh_remark'],
-                    $item['phone'],
+                    $item['withdraw_type'],
+                    $item['account_name'],
+                    $item['account_no'],
                 ];
             }
         }
-       //$title = ['序号','手机号','单号','提现金额','服务费','应到账','是否到账','申请时间','审核时间','审核状态','审核备注','提现方式','收款人','收款账号'];
-        $title = ['序号(选填)','收款方姓名','收款方银行卡号(必填)','金额(必填,单位:元)','附言(选填)','收款人手机号(选填)'];
+        $title = ['用户名','手机号','单号','提现金额','服务费','应到账','是否到账','申请时间','审核时间','审核状态','审核备注','提现方式','收款人','收款账号'];
         PHPExcelService::setExcelHeader($title)
             ->setExcelTile('提现记录导出' . date('YmdHis', time()), '提现记录' . time(), ' 生成时间:' . date('Y-m-d H:i:s', time()))
             ->setExcelContent($export)

+ 18 - 5
application/user/view/deposit/index.html

@@ -12,6 +12,7 @@
             <th class='text-left nowrap' >手续费(率)</th>
             <th class='text-left nowrap'  style="width: 20%">收款账号</th>
             <th class='text-left nowrap' >审核状态</th>
+            <th class='text-left nowrap' >打款详情</th>
             <th class='text-left nowrap' style="width: 12%">申请时间</th>
             <th class='text-left nowrap'>操作</th>
         </tr>
@@ -44,9 +45,9 @@
             <td class='text-left nowrap'>
                 <div class="inline-block">
                     类型:{eq name='vo.withdraw_type' value='wx'}微信{/eq}
-                        {eq name='vo.withdraw_type' value='zfb'}支付宝{/eq}
-                        {eq name='vo.withdraw_type' value='bank'}银行卡{/eq}
-                        <br>
+                    {eq name='vo.withdraw_type' value='zfb'}支付宝{/eq}
+                    {eq name='vo.withdraw_type' value='bank'}银行卡{/eq}
+                    <br>
                     账号:{$vo.account_no|default='--'}<br/>
                     收款人:{$vo.account_name|default='--'}
                 </div>
@@ -59,12 +60,24 @@
                     {eq name='vo.sh_status' value='2'}审核拒绝{/eq}
                 </div>
             </td>
+            <td class='text-left'>
+                <div class="inline-block">
+                    {if $vo.sh_status == 1}
+                    {eq name='vo.is_over' value='1'}打款成功{/eq}
+                    {eq name='vo.is_over' value='0'} {$vo.return_info.respDesc|default='--'}{/eq}
+                    {elseif $vo.sh_status == 2}
+                    余额已退回
+                    {elseif $vo.sh_status == 0}
+                    --
+                    {/if}
+                </div>
+            </td>
             <td class='text-left'>{$vo.create_at}</td>
             <td class='text-left'>
                 {if $vo['sh_status'] == 0}
-                    <a data-title="审核" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("edit")}?id={$vo.id}'>审核</a>
+                <a data-title="审核" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("edit")}?id={$vo.id}'>审核</a>
                 {else}
-                    <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查看</a>
+                <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查看</a>
                 {/if}
             </td>
         </tr>

+ 16 - 18
application/user/view/deposit/index_search.html

@@ -27,36 +27,34 @@
                 <select class="layui-select" name="type">
                     <option  value="-1">全部</option>
                     {foreach $dep_type as $k=>$v}
-                        {if $v}
-                            {if $Think.get.type eq $k}
-                                <option selected value="{$k}">{$v}</option>
-                            {else}
-                                <option  value="{$k}">{$v}</option>
-                            {/if}
-                        {/if}
+                    {if $v}
+                    {if $Think.get.type eq $k}
+                    <option selected value="{$k}">{$v}</option>
+                    {else}
+                    <option  value="{$k}">{$v}</option>
+                    {/if}
+                    {/if}
                     {/foreach}
                 </select>
             </div>
         </div>
 
-
         <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">审核状态</label>
+            <label class="layui-form-label">状态</label>
             <div class="layui-input-inline">
-                <select class="layui-select" name="sh_status">
+                <select class="layui-select" name="sel_sh">
                     <option  value="-1">全部</option>
-                    {foreach ['待审核','审核通过','审核拒绝'] as $k=>$v}
-                        {if $v}
-                            {if $Think.get.sh_status eq $k}
-                                <option selected value="{$k}">{$v}</option>
-                            {else}
-                                <option  value="{$k}">{$v}</option>
-                            {/if}
-                        {/if}
+                    {foreach $sh_arr as $sk=>$sv}
+                    {if $sel_sh eq $sk}
+                    <option selected value="{$sk}">{$sv}</option>
+                    {else}
+                    <option  value="{$sk}">{$sv}</option>
+                    {/if}
                     {/foreach}
                 </select>
             </div>
         </div>
+
         <div class="layui-form-item layui-inline">
             <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
         </div>