Browse Source

提现拒绝退回

lizhen_gitee 1 year ago
parent
commit
4e9f6232af

+ 15 - 0
application/admin/controller/CompanyTakeCash.php

@@ -92,7 +92,22 @@ class CompanyTakeCash extends Backend
                 'updatetime' => time(),
             ];
 
+            Db::startTrans();
             $rs = Db::name('company_take_cash')->where('id',$id)->update($data);
+            if($rs === false){
+                Db::rollback();
+                $this->error('审核失败');
+            }
+            if($status == 2){
+                //归还钱
+                $wallet_rs = model('walletcompany')->lockChangeAccountRemain($info['user_id'],'money',$info['money'],206,'提现退还:'.$info['money'],'company_take_cash',$info['id']);
+                if($wallet_rs['status'] === false){
+                    Db::rollback();
+                    $this->error($wallet_rs['msg']);
+                }
+            }
+
+            Db::commit();
 
             $this->success('审核完成');
         }

+ 1 - 1
application/api/library/ExceptionHandle.php

@@ -13,7 +13,7 @@ class ExceptionHandle extends Handle
 
     public function render(Exception $e)
     {
-        return parent::render($e);
+        //return parent::render($e);
         $statuscode = $code = 500;
         $msg = $e->getMessage();
         // 验证异常

+ 1 - 0
application/extra/wallet.php

@@ -15,6 +15,7 @@ return [
         203 => '售出套餐', //增加,仅限微信支付的套餐订单
         204 => '用户充值', //增加,跟着104一起加
         205 => '提现', //减少
+        206 => '提现拒绝退回', //增加
     ],
     'moneyname' => [
         'money'    => '储值卡',

+ 3 - 0
public/assets/js/backend/company_take_cash.js

@@ -54,6 +54,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     extend: 'data-area=["80%","80%"]',
                                     url:'company_take_cash/audit/id/{ids}?dialog=1',
                                     target:'_self',
+                                    hidden:function(row){
+                                        return row.status==0 ? false : true;
+                                    }
                                 },
                             ],
                             events: Table.api.events.operate, formatter: Table.api.formatter.operate}