|
@@ -9,6 +9,7 @@ use App\Models\BlockItems;
|
|
|
|
|
|
|
|
use App\Models\CoinType;
|
|
use App\Models\CoinType;
|
|
|
use App\Models\Config;
|
|
use App\Models\Config;
|
|
|
|
|
+use App\Models\Member;
|
|
|
use App\Models\MemberCoins;
|
|
use App\Models\MemberCoins;
|
|
|
|
|
|
|
|
use App\Servers\Icon\TronRPC;
|
|
use App\Servers\Icon\TronRPC;
|
|
@@ -26,7 +27,7 @@ class TronAnalyzeServer
|
|
|
public static function tronAnalyze()
|
|
public static function tronAnalyze()
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- $block_info = BlockInfo::where('id', 2)->first();
|
|
|
|
|
|
|
+ $block_info = BlockInfo::where('id', 1)->first();
|
|
|
if($block_info->{'num'}>=$block_info->{'analyze'} - 5 || true){
|
|
if($block_info->{'num'}>=$block_info->{'analyze'} - 5 || true){
|
|
|
$tron_block = TronRPC::CreationTron()->getBlockByNum();
|
|
$tron_block = TronRPC::CreationTron()->getBlockByNum();
|
|
|
}else{
|
|
}else{
|
|
@@ -75,35 +76,33 @@ class TronAnalyzeServer
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($block_item)) {
|
|
if (!empty($block_item)) {
|
|
|
- $member_coin = MemberCoins::where('coin_id', $block_item['coin_id'])->whereIn('address', [$block_item['to_a'],$block_item['from_a']])->first();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $member_coin = Member::whereIn('address', [$block_item['to_a'],$block_item['from_a']])->select(['id','address'])->first();
|
|
|
|
|
|
|
|
if (!empty($member_coin)) {
|
|
if (!empty($member_coin)) {
|
|
|
- $block_item['m_id'] = $member_coin->{'m_id'};
|
|
|
|
|
|
|
+ $block_item['m_id'] = $member_coin->{'id'};
|
|
|
$block_item['to_type'] = $block_item['to_a']==$member_coin->{'address'}?1:2;
|
|
$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();
|
|
$item_num = BlockItems::where('m_id', $block_item['m_id'])->where('hash', $block_item['hash'])->where('coin_id', $block_item['coin_id'])->count();
|
|
|
- $receipt_trx='TC35X33LLF3ARY1P1HzYZaFngVCH5GKLjv';
|
|
|
|
|
- if ($item_num <= 0 && $block_item['to_type']==1) {
|
|
|
|
|
- //添加广播转账信息
|
|
|
|
|
|
|
+ if($item_num<=0){
|
|
|
$block_item = BlockItems::create($block_item);
|
|
$block_item = BlockItems::create($block_item);
|
|
|
- $mix_num = 0.01;
|
|
|
|
|
- if ($block_item['money'] >= $mix_num) {
|
|
|
|
|
- BroadcastServer::addBroadcast($block_item['coin_id'], $block_item['money'], $member_coin['address'], $member_coin['private'], $receipt_trx, $member_coin['m_id'], $block_item->{'id'}, 1);
|
|
|
|
|
- }
|
|
|
|
|
- }elseif ($item_num <= 0 && $block_item['to_type']==2){
|
|
|
|
|
- if( $block_item['to_a']==$receipt_trx){
|
|
|
|
|
- $block_item = BlockItems::create($block_item);
|
|
|
|
|
- //转出成功后天就余额
|
|
|
|
|
|
|
+ $receipt_trx='TC35X33LLF3ARY1P1HzYZaFngVCH5GKLjv';
|
|
|
|
|
+ if($block_item['to_type']==1){
|
|
|
|
|
+ //转入,检测提现相关状态
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //转出,检测转入的是否是系统账户,系统账户就进行报单操作
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- BlockInfo::where('id', 2)->update(['analyze' => $block_info->{'analyze'} + 1, 'num' => $tron_block]);
|
|
|
|
|
|
|
+ dump(['analyze' => $block_info->{'analyze'} + 1, 'num' => $tron_block]);
|
|
|
|
|
+ BlockInfo::where('id', 1)->update(['analyze' => $block_info->{'analyze'} + 1, 'num' => $tron_block]);
|
|
|
DB::commit();
|
|
DB::commit();
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|