Commit b74973be authored by shajiaiming's avatar shajiaiming

投注信息增加区块高度判断

parent 2135ea03
...@@ -31,18 +31,17 @@ class GameBetController extends Controller ...@@ -31,18 +31,17 @@ class GameBetController extends Controller
$resultJSON = json_decode($queryResultItems['queryResultItems'][0]['resultJSON'],true); $resultJSON = json_decode($queryResultItems['queryResultItems'][0]['resultJSON'],true);
$current_round = $resultJSON['current_round']; $current_round = $resultJSON['current_round'];
// $cache_current_round = Yii::$app->redis->get('chain33_game_bet_status'); $cache_current_round = Yii::$app->redis->get('chain33_game_bet_status');
// if(empty($cache_current_round)){ if(empty($cache_current_round)){
// $cache_current_round = CoinGameBet::find()->max('round'); $cache_current_round = CoinGameBet::find()->max('round');
// Yii::$app->redis->set('chain33_game_bet_status',$cache_current_round,'EX',300); Yii::$app->redis->set('chain33_game_bet_status',$cache_current_round,'EX',300);
// } }
// $cache_current_round = (false == $cache_current_round ? 0 : $cache_current_round); $cache_current_round = (false == $cache_current_round ? 0 : $cache_current_round);
// if($cache_current_round >= $current_round){ if($cache_current_round >= $current_round){
// echo date('Y-m-d H:i:s') . '数据已为最新'.PHP_EOL; echo date('Y-m-d H:i:s') . '数据已为最新'.PHP_EOL;
// return 0; return 0;
// } }
// Yii::$app->redis->set('chain33_game_bet_status',$current_round,'EX',300); Yii::$app->redis->set('chain33_game_bet_status',$current_round,'EX',300);
$cache_current_round = 55470;
$result = $service->getBetStatus($cache_current_round, $current_round); $result = $service->getBetStatus($cache_current_round, $current_round);
if( 0 !== $result['code']){ if( 0 !== $result['code']){
echo date('Y-m-d H:i:s') . '数据错误'.PHP_EOL; echo date('Y-m-d H:i:s') . '数据错误'.PHP_EOL;
......
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