Commit 59daad70 authored by shajiaiming's avatar shajiaiming

fix

parent 1f47c4b6
......@@ -37,7 +37,6 @@ class GameBetController extends Controller
$resultJSON = json_decode($queryResultItems['queryResultItems'][0]['resultJSON'], true);
$current_round = $resultJSON['current_round'];
$current_height = $resultJSON['height'];
$cache_current_round = Yii::$app->redis->get('chain33_game_bet_status_'.$key);
if (empty($cache_current_round)) {
$cache_current_round = CoinGameBet::find()->where(['platform' => $key])->max('round');
......@@ -49,7 +48,6 @@ class GameBetController extends Controller
continue;
}
Yii::$app->redis->set('chain33_game_bet_status_'.$key, $current_round, 'EX', 300);
Yii::$app->redis->set('chain33_game_bet_status_height_'.$key, $current_height, 'EX', 300);
$result = $service->getBetStatus($cache_current_round, $current_round, '', $node);
if (0 !== $result['code']) {
echo $key.':'.date('Y-m-d H:i:s') . '数据错误' . PHP_EOL;
......@@ -99,18 +97,10 @@ class GameBetController extends Controller
$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;
$models = CoinGameBet::find()->select('round')->where([
'and',
['valid' => CoinGameBet::VAILD_FALSE],
['<', 'height', $cache_current_height],
['<', 'height', $current_height - 12],
['platform' => $key]
])->all();
if(empty($models)){
......
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