afa 6 сар өмнө
parent
commit
aabd8ee4a8

+ 18 - 1
application/admin/view/offline/offline_withdraw/approve.html

@@ -20,13 +20,30 @@
             <label class="control-label col-xs-12 col-sm-2">{$row.amount}</label>
         </div>
     </div>
-
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">到账金额:</label>
         <div class="col-xs-12 col-sm-2">
             <label class="control-label col-xs-12 col-sm-2">{$row.real_amount}</label>
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">汇率:</label>
+        <div class="col-xs-12 col-sm-2">
+            <label class="control-label col-xs-12 col-sm-2">{$row.rate}</label>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">手续费:</label>
+        <div class="col-xs-12 col-sm-2">
+            <label class="control-label col-xs-12 col-sm-2">{$row.fee}</label>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">实际到账金额:</label>
+        <div class="col-xs-12 col-sm-2">
+            <label class="control-label col-xs-12 col-sm-2">{$row.usdt}</label>
+        </div>
+    </div>
 
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">审核结果:</label>

+ 10 - 5
application/api/controller/Offline.php

@@ -59,12 +59,17 @@ class Offline extends Api
             $this->error(__('The withdrawal amount cannot be less than') . $min);
         }
         // 扣除手续费后
+        $rate = getConfig('convert_rate');
         if($amount < config('withdraw_in_amount')){
-            $res_amount= bcsub($amount, getConfig('withdrawal_next_fee'),6); //扣除茶宝之后金额
-            $real      = bcdiv($res_amount, getConfig('convert_rate'), 6); // 折合转换 U = 1
+            $feeRate   = getConfig('withdrawal_next_fee');
+            $real      = bcsub($amount, $feeRate,6); //扣除茶宝之后金额
+            $usdt      = bcdiv($real, $rate, 6); // 折合转换 U = 1
+            $fee       = $feeRate.'茶宝';
         } else{
-            $real   = bcdiv($amount, getConfig('convert_rate'), 6); // 折合转换 U = 1
-            $real   = bcmul($real, bcsub(1, getConfig('withdrawal_up_fee'), 6), 6); // 扣除手续费后
+            $feeRate= getConfig('withdrawal_up_fee');
+            $real   = bcmul($amount, bcsub(1, $feeRate, 6), 6); // 折合转换 U = 1
+            $usdt   = bcdiv($real, $rate, 6); // 扣除手续费后
+            $fee    = ($feeRate*100).'%';
         }
         $uid = $this->auth->getTokenUserID();
         // 用户信息
@@ -85,7 +90,7 @@ class Offline extends Api
 
             // 创建提现记录
             $txHash = Random::uuid();
-            (new OfflineWithdrawRecordModel())->createWithdraw($txHash, $uid, $amount, $real, $address, 'usdt');
+            (new OfflineWithdrawRecordModel())->createWithdraw($txHash, $uid, $amount, $real, $address, 'usdt', $usdt, $rate, $fee);
 
             // 提交事务
             Db::commit();

+ 4 - 1
application/common/model/OfflineWithdrawRecordModel.php

@@ -28,7 +28,7 @@ class OfflineWithdrawRecordModel extends Model
         self::StatusReturn      => '驳回',
         self::StatusFail        => '失败'
     ];
-    public function createWithdraw(string $txHash, int $uid, string $amount, string $real, string $to_address, string $symbol)
+    public function createWithdraw(string $txHash, int $uid, string $amount, string $real, string $to_address, string $symbol, string $usdt, string $rate, string $fee)
     {
         switch ($symbol) {
             case 'usdt':
@@ -49,6 +49,9 @@ class OfflineWithdrawRecordModel extends Model
         $insert['to_address']  = $to_address;
         $insert['amount']      = $amount;
         $insert['real_amount'] = $real;
+        $insert['fee']         = $fee; //手续费
+        $insert['rate']        = $rate; //汇集计
+        $insert['usdt']        = $usdt; //汇集计算之后实际金额
         $insert['status']      = WithdrawStatus::StatusPending;
         $insert['create_time'] = time();
         $this->insert($insert);

+ 23 - 3
public/assets/js/backend/offline/offline_withdraw.js

@@ -35,8 +35,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         // {field: 'frozen_id', title: __('Frozen_id')},
                         {field: 'tx_hash', title: __('Tx_hash'), operate: 'LIKE'},
                         {field: 'user_id', title: __('User_id')},
-                        {field: 'address', title: '账号地址'},
-                        {field: 'to_address', title: '提现地址'},
+                        {field: 'address', title: '账号地址',cellStyle : function(value, row, index, field){
+                            return {
+                                css: {
+                                    "white-space": "nowrap",
+                                    "text-overflow": "ellipsis",
+                                    "overflow": "hidden",
+                                    "max-width":"300px"
+                                }
+                            };
+                        }},
+                        {field: 'to_address', title: '提现地址',cellStyle : function(value, row, index, field){
+                            return {
+                                css: {
+                                    "white-space": "nowrap",
+                                    "text-overflow": "ellipsis",
+                                    "overflow": "hidden",
+                                    "max-width":"300px"
+                                }
+                            };
+                        }},
                         {field: 'symbol', title: __('Symbol'), operate: 'LIKE'},
                         {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
                         {field: 'real_amount', title: __('Real_amount'), operate:'BETWEEN'},
@@ -51,7 +69,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 '500': '取消',
                             }, operate: 'FIND_IN_SET', formatter: Table.api.formatter.label
                         },
-                        // {field: 'admin_id', title: __('Admin_id')},
+                        {field: 'usdt', title: __('实际到账金额')},
+                        {field: 'rate', title: __('汇率')},
+                        {field: 'fee', title: __('手续费')},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {