Browse Source

no message

BF-202205051124\Administrator 3 years ago
parent
commit
f957d1c075
1 changed files with 1 additions and 21 deletions
  1. 1 21
      app/Servers/TronAnalyzeServer.php

+ 1 - 21
app/Servers/TronAnalyzeServer.php

@@ -40,26 +40,21 @@ class TronAnalyzeServer
             DB::beginTransaction();
             if (!empty($block_deal['transactions'])) {
                 //USDT 合约地址  0xdac17f958d2ee523a2206206994597c13d831ec7
-//                $hy_address = Config::where('key', 'hy_address')->value('value');
                 $hy_address = '41a614f803b6fd780986a42c78ec9c7f77e6ded13c';
                 foreach ($block_deal['transactions'] as $t_key=>$deal_info) {
                     if(empty($deal_info['ret'][0]['contractRet']) || $deal_info['ret'][0]['contractRet']!='SUCCESS'){
                         continue;
                     }
-//                    var_dump('---------OK');
                     $block_item = [];
                     $pay_data=$deal_info['raw_data']['contract'][0]['parameter']['value'];
                     $my_hy_address=empty($pay_data['contract_address']) ?'':$pay_data['contract_address'];
-
                     if ( $my_hy_address == $hy_address) {
                         if(empty($pay_data['data']))continue;
                         $input = $pay_data['data'];
                         $to = '41'.substr($input, 32, 40);
                         $value = substr($input, 72);
                         $money = Utils::int2fund(Utils::hex2dec('0x' . $value), 6);
-
                         $to = TronRPC::CreationTron()->getBase58CheckAddress(hex2bin($to));
-
                         $block_item = [
                             'm_id' => 0,
                             'coin_id' => 4,
@@ -73,8 +68,6 @@ class TronAnalyzeServer
                             'fee_limit' =>empty($deal_info['raw_data']['fee_limit'])?0:$deal_info['raw_data']['fee_limit'],
                         ];
                     }
-
-
                     if (!empty($block_item)) {
                         $member_coin = Member::whereIn('address', [$block_item['to_a'],$block_item['from_a']])->select(['id','address'])->first();
 
@@ -83,25 +76,12 @@ class TronAnalyzeServer
                             $block_item['to_type'] = $block_item['to_a']==$member_coin->{'address'}?1:2;
                             $item_num = BlockItems::where('m_id', $block_item['m_id'])->where('hash', $block_item['hash'])->where('coin_id', $block_item['coin_id'])->count();
                             if($item_num<=0){
-                                $block_item = BlockItems::create($block_item);
-                                $receipt_trx='TC35X33LLF3ARY1P1HzYZaFngVCH5GKLjv';
-                                if($block_item['to_type']==1){
-                                    //转入,检测提现相关状态
-
-                                }else{
-                                    //转出,检测转入的是否是系统账户,系统账户就进行报单操作
-
-                                }
+                                BlockItems::create($block_item);
                             }
-
-
                         }
-
-
                     }
                 }
             }
-            dump(['analyze' => $block_info->{'analyze'} + 1, 'num' => $tron_block]);
             BlockInfo::where('id', 1)->update(['analyze' => $block_info->{'analyze'} + 1, 'num' => $tron_block]);
             DB::commit();
             return true;