Browse Source

格式化兑换页面的小数
优化后台兑换记录

jason 6 months ago
parent
commit
4f7f196891

+ 15 - 12
application/admin/lang/zh-cn/offline/rwa_exchange_record.php

@@ -1,16 +1,19 @@
 <?php
 
 return [
-    'Order_no'     => '订单号',
-    'Tx_hash'      => '交易哈希',
-    'User_id'      => '用户',
-    'Symbol'       => '币种',
-    'Amount'       => '金额',
-    'Product_id'   => '发放产品',
-    'From_address' => '转出地址',
-    'To_address'   => '收币地址',
-    'Status'       => '状态',
-    'Create_time'  => '创建时间',
-    'Block_number' => '最新扫描的最新区块',
-    'Note'         => '备注'
+    'Order_no'              => '订单号',
+    'User_id'               => '用户',
+    'Symbol'                => '币种',
+    'Tx_hash_Usdt'          => 'USDT交易哈希',
+    'Tx_hash_token'         => '代币交易哈希',
+    'Amount_usdt'           => 'USDT金额',
+    'Amount_token'          => '代币金额',
+    'Product_id'            => '发放产品ID',
+    'From_address_usdt'     => 'U转出地址',
+    'From_address_token'    => '代币转出地址',
+    'To_address'            => '收币地址',
+    'Status'                => '状态',
+    'Create_time'           => '创建时间',
+    'Block_number'          => '最新扫描的最新区块',
+    'Note'                  => '备注'
 ];

+ 11 - 1
application/api/controller/Exchange.php

@@ -49,7 +49,17 @@ class Exchange extends Api
 
             $ids = $this->request->post('ids');
             if (empty($ids)) $this->error(__('Parameter error'));
-            $this->success('ok', ['data'=>$productWelfareRede::get($ids), 'desc'=> config('welfare_rede_desc')]);
+            $welfare = $productWelfareRede::get($ids);
+            $data_info = [
+                'title' => $welfare['title'],
+                'product_image' => $welfare['product_image'],
+                'transfer_address' => $welfare['transfer_address'],
+                'usdt_num' => round($welfare['usdt_num'],2),
+                'is_token' => $welfare['is_token'],
+                'token_name' => $welfare['token_name'],
+                'token_num' => round($welfare['token_num'], 2),
+            ];
+            $this->success('ok', ['data'=>$data_info, 'desc'=> config('welfare_rede_desc')]);
       }
 
 

+ 12 - 9
public/assets/js/backend/offline/rwa_exchange_record.js

@@ -24,6 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id'), operate: false},
+                        {field: 'users.address', title: __('User_id'),operate: 'LIKE'},
                         {
                             field: 'welfarereda.title', 
                             title: __('福利兑换'), 
@@ -43,17 +44,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             }
                         },
                         {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
-                        {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
-                        {field: 'tx_hash', title: __('Tx_hash'), operate: 'LIKE'},
-                        {field: 'users.address', title: __('User_id'),operate: 'LIKE'},
-                        {field: 'symbol', title: __('Symbol'), operate: false},
-                        {field: 'amount', title: __('Amount'), operate:false},
                         {field: 'product_id', title: __('发放产品ID'), operate:'LIKE'},
-                        {field: 'from_address', title: __('From_address'), operate: 'LIKE'},
+                        {field: 'id', title: __('Symbol'), operate: false,
+                            formatter: function (value, row, index) {
+                                return 'USDT';
+                            }},
+                        {field: 'tx_hash_usdt', title: __('Tx_hash_Usdt'), operate: 'LIKE'},
+                        {field: 'from_address_usdt', title: __('From_address_usdt'), operate: 'LIKE'},
+                        {field: 'amount_usdt', title: __('Amount_usdt'), operate:false},
+                        {field: 'token_name', title: __('Symbol'), operate: 'LIKE'},
+                        {field: 'tx_hash_token', title: __('Tx_hash_token'), operate: 'LIKE'},
+                        {field: 'from_address_token', title: __('From_address_token'), operate: 'LIKE'},
+                        {field: 'amount_token', title: __('Amount_token'), operate:false},
                         {field: 'to_address', title: __('To_address'), operate: 'LIKE'},
-                        {field: 'status', title: __('Status'), searchList: {
-                            "100":__('待确认'),"200":__('成功'),"400":__('失败')
-                        }, formatter: Table.api.formatter.status},
                         {field: 'create_time', title: __('Create_time'), operate: false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'note', title: __('Note'), operate: false},
                         //{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}