Commit 3cecfa21 authored by shajiaiming's avatar shajiaiming

rollback

parent 95ac3bcb
......@@ -83,35 +83,14 @@ class GameBetController extends Controller
echo date('Y-m-d H:i:s') . '无节点'.PHP_EOL;
return 0;
}
foreach ($nodes as $key => $node) {
$service = new Chain33Business();
$result = $service->getGameStatus($node);
if (0 !== $result['code']) {
echo $key.':'.date('Y-m-d H:i:s') . $result['msg'].PHP_EOL;
continue;
}
$queryResultItems = $result['result'] ?? [];
if (empty($queryResultItems)) {
echo $key.':'.date('Y-m-d H:i:s') . 'error'.PHP_EOL;
continue;
}
$resultJSON = json_decode($queryResultItems['queryResultItems'][0]['resultJSON'], true);
$current_height = $resultJSON['height'];
$cache_current_height = Yii::$app->redis->get('chain33_game_bet_status_height_'.$key);
if(($cache_current_height + 12) < $current_height) {
echo $key.':'.date('Y-m-d H:i:s') . '区块高度小于12'.PHP_EOL;
continue;
}
$height = $cache_current_height - 12;
$result = $service->getLastHeader($node);
$height = $result['result']['height'];
$models = CoinGameBet::find()->select('round')->where([
'and',
['valid' => CoinGameBet::VAILD_FALSE],
['<', 'height', $height],
['<', 'height', $height - 12],
['platform' => $key]
])->all();
if(empty($models)){
......@@ -154,4 +133,5 @@ class GameBetController extends Controller
}
return 0;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment