Parcourir la source

创建测试文件

jason il y a 6 mois
Parent
commit
f41c656c66
1 fichiers modifiés avec 13 ajouts et 7 suppressions
  1. 13 7
      application/api/controller/debug.php

+ 13 - 7
application/common/controller/debug.php → application/api/controller/debug.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace app\common\controller;
+namespace app\api\controller;
 
 use think\Db;
 
@@ -15,30 +15,36 @@ class debug
             $order_list = Db::name('rwa_exchange_record_1')->where('order_no', $order_no)->select();
             $usdt_info = $token_info = [];
             foreach ($order_list as $item) {
-                if ($order['symbol'] == 'USDT') {
+                if ($item['symbol'] == 'USDT') {
                     $usdt_info = $item;
                 } else {
                     $token_info = $item;
                 }
             }
 
-            $inster_data[] = [
+            dump($usdt_info);
+            dump($token_info);
+
+            $inster_data = [
                 'order_no' => $order_no,
                 'user_id' => $order['user_id'],
                 'welfare_id' => 1,
                 'product_id' => $order['product_id'],
-                'tx_hash_usdt' => $usdt_info['hash'],
+                'tx_hash_usdt' => $usdt_info['tx_hash'],
                 'from_address_usdt' => $usdt_info['from_address'],
                 'amount_usdt' => $usdt_info['amount'],
                 'token_name' => $token_info['symbol'],
                 'from_address_token' => $token_info['from_address'],
                 'amount_token' => $token_info['amount'],
-                'tx_hash_token' => $token_info['hash'],
+                'tx_hash_token' => $token_info['tx_hash'],
                 'to_address' => $order['to_address'],
-                'create_time' => time()
+                'create_time' => $token_info['create_time']
             ];
 
-            Db::name('rwa_exchange_record_back')->insert($inster_data);
+            dump('拼接数据');
+            dump($inster_data);
+            $rs = Db::name('rwa_exchange_record_back')->insert($inster_data);
+            dump($rs);
             dump('完成:' . $order_no);
             $i++;
         }