WIN-2308041133\Administrator 6 months ago
parent
commit
0490cbc087
1 changed files with 8 additions and 5 deletions
  1. 8 5
      application/api/controller/Pay.php

+ 8 - 5
application/api/controller/Pay.php

@@ -909,7 +909,7 @@ class Pay extends Api
         $data = [
             'order_id'=> $number,
             'uid' => $uid,
-            'pid' => 0,
+            'paid' => 0,
             'add_time' => time()
         ];
         $return = [];
@@ -941,10 +941,13 @@ class Pay extends Api
 //                $info =$service->getLastTransfer([], ['0x8f5f8daC38461E5b1A6b230D30433f8A593CCD57'], 1748315888);
                 $info =$service->getLastTransfer([], [$user_address['bsc_address']], $user_address['last_time']);
                 foreach ($info as $k2 => $v2){
-                    $value = $v2->params['value']->toString();
-
-                    $value2 = bcdiv($value, bcpow(10, get_token_info('bsc',$v2['token'], 'decimal')), 12);
-
+                    $value = $v2->params['value']->toString();  //金额
+                    $value2 = bcdiv($value, bcpow(10, get_token_info('bsc','USDT', 'decimal')), 12);
+                    $transactionHash = $v->transactionHash;
+                    $be=DB::name('user_recharge')->where('hash',$transactionHash)->find();
+                    if ($be){  //hash重复
+                        continue;
+                    }
                 }
             }