Commit a9a3118e authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/sakura' into 'master'

Feature/sakura See merge request !32
parents 920ee7b7 24e10c74
......@@ -96,6 +96,10 @@ class ServiceController extends BaseController
$coin_recommendItems = $this->coinRecommendList($platform_id);
$fields =['id', 'sid', 'icon', 'name', 'nickname','chain','platform'];
$rows = Coin::getSelectList(1, 999, $fields,[['in','id',$coin_recommendItems]]);
foreach ($rows['data'] as $key => &$value) {
$nickname = json_decode($value['nickname'], true);
$value['nickname'] = $nickname[$this->lang];
}
return ['code' => 0,'data' => $rows,'msg' => '币种列表获取成功'];
}
......
......@@ -108,6 +108,7 @@ class CoinController extends BaseController
$introduce[$lang[$key]] = $val;
}
unset($data['nickname']);
unset($data['introduce']);
$data['nickname'] = $nickname;
$data['introduce'] = $introduce;
$result = $coin->addOne($data);
......
......@@ -169,7 +169,7 @@ class Chain33Business
$service = new Chain33Service($node_params);
$execer = 'wasm';
$funcName = 'WasmGetContractTable';
$contractName = 'user.p.para.user.wasm.dice';
$contractName = 'user.p.tschain.user.wasm.dice';
$items[] = [
'tableName' => 'gamestatus',
'key' => 'dice_statics'
......@@ -189,7 +189,7 @@ class Chain33Business
$service = new Chain33Service($node_params);
$execer = 'wasm';
$funcName = 'WasmGetContractTable';
$contractName = 'user.p.para.user.wasm.dice';
$contractName = 'user.p.tschain.user.wasm.dice';
for($i = $start + 1; $i <= $end; $i++){
$items[] = [
'tableName' => 'roundinfo',
......
......@@ -31,17 +31,17 @@ class GameBetController extends Controller
$resultJSON = json_decode($queryResultItems['queryResultItems'][0]['resultJSON'],true);
$current_round = $resultJSON['current_round'];
$cache_current_round = Yii::$app->redis->get('chain33_game_status');
$cache_current_round = Yii::$app->redis->get('chain33_game_bet_status');
if(empty($cache_current_round)){
$cache_current_round = CoinGameBet::find()->max('round');
Yii::$app->redis->set('chain33_game_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);
if($cache_current_round >= $current_round){
echo date('Y-m-d H:i:s') . '数据已为最新'.PHP_EOL;
return 0;
}
Yii::$app->redis->set('chain33_game_status',$current_round,'EX',300);
Yii::$app->redis->set('chain33_game_bet_status',$current_round,'EX',300);
$result = $service->getBetStatus($cache_current_round, $current_round);
if( 0 !== $result['code']){
echo date('Y-m-d H:i:s') . '数据错误'.PHP_EOL;
......
#!/bin/bash
while true; do php /var/www/html/token_pwallet/yii game-bet/game-status >> /var/log/game-bet.log 2>&1; sleep 5; done &
\ 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