Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
726e5c9c
Commit
726e5c9c
authored
Aug 01, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/game' into 'master'
Feature/game See merge request
!69
parents
330fabcf
7a15756a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
145 additions
and
111 deletions
+145
-111
GameBetController.php
api/controllers/GameBetController.php
+4
-52
GameController.php
api/controllers/GameController.php
+50
-6
Chain33Business.php
common/business/Chain33Business.php
+5
-8
CoinGameBet.php
common/models/psources/CoinGameBet.php
+1
-1
GameUserAddress.php
common/models/pwallet/GameUserAddress.php
+25
-0
GameBetController.php
console/controllers/GameBetController.php
+60
-44
No files found.
api/controllers/GameBetController.php
View file @
726e5c9c
...
@@ -10,61 +10,12 @@ use yii\data\Pagination;
...
@@ -10,61 +10,12 @@ use yii\data\Pagination;
class
GameBetController
extends
BaseController
class
GameBetController
extends
BaseController
{
{
/**
* 获取游戏状态
*
* @return array
*/
public
function
actionGameStatus
()
{
$service
=
new
Chain33Business
();
$result
=
$service
->
getGameStatus
();
if
(
0
!==
$result
[
'code'
]){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
$result
[
'msg'
]];
}
$queryResultItems
=
$result
[
'result'
]
??
[];
if
(
empty
(
$queryResultItems
)){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'error'
];
}
$resultJSON
=
json_decode
(
$queryResultItems
[
'queryResultItems'
][
0
][
'resultJSON'
],
true
);
$current_round
=
$resultJSON
[
'current_round'
];
$cache_current_round
=
Yii
::
$app
->
redis
->
get
(
'chain33_game_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
);
}
$cache_current_round
=
(
false
==
$cache_current_round
?
0
:
$cache_current_round
);
if
(
$cache_current_round
>=
$current_round
){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'数据已为最新'
];
}
Yii
::
$app
->
redis
->
set
(
'chain33_game_status'
,
$current_round
,
'EX'
,
300
);
$result
=
$service
->
getBetStatus
(
$cache_current_round
,
$current_round
);
if
(
0
!==
$result
[
'code'
]){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'数据错误'
];
}
$queryResultItems
=
$result
[
'result'
]
??
[];
if
(
empty
(
$queryResultItems
)){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'数据错误'
];
}
foreach
(
$queryResultItems
[
'queryResultItems'
]
as
$key
=>
$val
){
if
(
false
==
$val
[
'found'
]
)
continue
;
$resultArr
=
json_decode
(
$val
[
'resultJSON'
],
true
);
$datas
[]
=
[
$resultArr
[
'round'
],
$resultArr
[
'player'
],
$resultArr
[
'amount'
],
$resultArr
[
'height'
],
$resultArr
[
'guess_num'
],
$resultArr
[
'rand_num'
],
$resultArr
[
'player_win'
]
];
}
CoinGameBet
::
loadArray
(
$datas
);
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'数据更新成功'
];
}
public
function
actionBetStatus
()
public
function
actionBetStatus
()
{
{
$platform
=
Yii
::
$app
->
request
->
get
(
'platform'
,
'ts_wallet'
);
$player
=
Yii
::
$app
->
request
->
get
(
'player'
,
''
);
$player
=
Yii
::
$app
->
request
->
get
(
'player'
,
''
);
$page
=
Yii
::
$app
->
request
->
get
(
'page'
,
1
);
$page
=
Yii
::
$app
->
request
->
get
(
'page'
,
1
);
if
(
empty
(
$player
)){
if
(
empty
(
$player
)
||
empty
(
$platform
)
){
$msg
=
'请求参数错误'
;
$msg
=
'请求参数错误'
;
$code
=
-
1
;
$code
=
-
1
;
$data
=
null
;
$data
=
null
;
...
@@ -72,8 +23,9 @@ class GameBetController extends BaseController
...
@@ -72,8 +23,9 @@ class GameBetController extends BaseController
}
}
$query
=
CoinGameBet
::
find
()
$query
=
CoinGameBet
::
find
()
->
select
(
'round, player, amount, height, guess_num, guess_num, rand_num, player_win'
)
->
select
(
'round, player, amount, height, guess_num, guess_num, rand_num, player_win
, platform
'
)
->
where
(
'player= :player'
,[
':player'
=>
$player
])
->
where
(
'player= :player'
,[
':player'
=>
$player
])
->
andWhere
([
'platform'
=>
$platform
])
#->andWhere(['valid' => CoinGameBet::VAILD_TRUE])
#->andWhere(['valid' => CoinGameBet::VAILD_TRUE])
->
orderBy
(
'update_time desc'
);
->
orderBy
(
'update_time desc'
);
...
...
api/controllers/GameController.php
View file @
726e5c9c
...
@@ -11,15 +11,18 @@ namespace api\controllers;
...
@@ -11,15 +11,18 @@ namespace api\controllers;
use
Yii
;
use
Yii
;
use
api\base\BaseController
;
use
api\base\BaseController
;
use
common\models\pwallet\GameUser
;
use
common\models\pwallet\GameUser
;
use
common\models\pwallet\GameUserAddress
;
class
GameController
extends
BaseController
{
class
GameController
extends
BaseController
{
/**
/**
* 保存地址与昵称
* 保存地址与昵称
*/
*/
public
function
actionSaveAddressAndNickname
(){
public
function
actionSaveAddressAndNickname
()
{
$post
=
Yii
::
$app
->
request
->
post
();
$post
=
Yii
::
$app
->
request
->
post
();
$address
=
$post
[
'address'
]
??
''
;
$address
=
$post
[
'address'
]
??
''
;
$nickname
=
$post
[
'nickname'
]
??
''
;
$nickname
=
$post
[
'nickname'
]
??
''
;
if
(
empty
(
$address
)
||
empty
(
$nickname
))
{
if
(
empty
(
$address
)
||
empty
(
$nickname
))
{
return
[
'code'
=>
-
1
,
'msg'
=>
'地址和昵称不能为空'
,
'data'
=>
''
];
return
[
'code'
=>
-
1
,
'msg'
=>
'地址和昵称不能为空'
,
'data'
=>
''
];
}
}
...
@@ -41,7 +44,8 @@ class GameController extends BaseController {
...
@@ -41,7 +44,8 @@ class GameController extends BaseController {
/**
/**
* 根据地址获取昵称
* 根据地址获取昵称
*/
*/
public
function
actionGetNicknameByAddress
(){
public
function
actionGetNicknameByAddress
()
{
$address
=
Yii
::
$app
->
request
->
post
(
'address'
,
''
);
$address
=
Yii
::
$app
->
request
->
post
(
'address'
,
''
);
if
(
empty
(
$address
))
{
if
(
empty
(
$address
))
{
return
[
'code'
=>
-
1
,
'msg'
=>
'地址不能为空'
,
'data'
=>
''
];
return
[
'code'
=>
-
1
,
'msg'
=>
'地址不能为空'
,
'data'
=>
''
];
...
@@ -49,7 +53,47 @@ class GameController extends BaseController {
...
@@ -49,7 +53,47 @@ class GameController extends BaseController {
//todo 获取地址
//todo 获取地址
$address
=
GameUser
::
find
()
->
select
([
'nickname'
])
->
where
([
'address'
=>
$address
])
->
one
();
$address
=
GameUser
::
find
()
->
select
([
'nickname'
])
->
where
([
'address'
=>
$address
])
->
one
();
if
(
!
empty
(
$address
))
{
if
(
!
empty
(
$address
))
{
return
[
'code'
=>
0
,
'msg'
=>
'Succeed'
,
'data'
=>
$address
];
return
[
'code'
=>
0
,
'msg'
=>
'Succeed'
,
'data'
=>
$address
];
}
return
[
'code'
=>
-
1
,
'msg'
=>
'Failed'
];
}
public
function
actionSaveGameInfo
()
{
$post
=
Yii
::
$app
->
request
->
post
();
$address
=
$post
[
'address'
]
??
''
;
$nickname
=
$post
[
'nickname'
]
??
''
;
if
(
empty
(
$address
)
||
empty
(
$nickname
))
{
return
[
'code'
=>
-
1
,
'msg'
=>
'地址和昵称不能为空'
,
'data'
=>
null
];
}
//判断重复
$count
=
GameUserAddress
::
find
()
->
where
([
'address'
=>
$address
])
->
count
();
if
(
$count
>
0
)
{
return
[
'code'
=>
-
1
,
'msg'
=>
'地址已存在'
,
'data'
=>
null
];
}
// todo 保存
$models
=
new
GameUserAddress
();
$models
->
nickname
=
$nickname
;
$models
->
address
=
$address
;
if
(
$models
->
save
())
{
return
[
'code'
=>
0
,
'msg'
=>
'Succeed'
,
'data'
=>
$models
->
id
];
}
return
[
'code'
=>
-
1
,
'msg'
=>
'Failed'
,
'data'
=>
null
];
}
public
function
actionGetNicknameByAddressArr
()
{
$address
=
Yii
::
$app
->
request
->
post
(
'address'
,
''
);
if
(
empty
(
$address
))
{
return
[
'code'
=>
-
1
,
'msg'
=>
'地址不能为空'
,
'data'
=>
''
];
}
//todo 获取地址
$address
=
GameUserAddress
::
find
()
->
select
([
'nickname'
,
'address'
])
->
where
([
'in'
,
'address'
,
$address
])
->
asArray
()
->
all
();
if
(
!
empty
(
$address
))
{
return
[
'code'
=>
0
,
'msg'
=>
'Succeed'
,
'data'
=>
$address
];
}
}
return
[
'code'
=>
-
1
,
'msg'
=>
'Failed'
];
return
[
'code'
=>
-
1
,
'msg'
=>
'Failed'
];
}
}
...
...
common/business/Chain33Business.php
View file @
726e5c9c
...
@@ -159,13 +159,12 @@ class Chain33Business
...
@@ -159,13 +159,12 @@ class Chain33Business
* 获取游戏状态
* 获取游戏状态
* @return array
* @return array
*/
*/
public
static
function
getGameStatus
()
public
static
function
getGameStatus
(
$node_params
=
[]
)
{
{
$node_params
=
\Yii
::
$app
->
params
[
'chain_parallel'
][
'wasm'
];
$service
=
new
Chain33Service
(
$node_params
);
$service
=
new
Chain33Service
(
$node_params
);
$execer
=
'wasm'
;
$execer
=
'wasm'
;
$funcName
=
'WasmGetContractTable'
;
$funcName
=
'WasmGetContractTable'
;
$contractName
=
'user.p.tschain.user.wasm.dice'
;
$contractName
=
$node_params
[
'contractName'
]
;
$items
[]
=
[
$items
[]
=
[
'tableName'
=>
'gamestatus'
,
'tableName'
=>
'gamestatus'
,
'key'
=>
'dice_statics'
'key'
=>
'dice_statics'
...
@@ -179,13 +178,12 @@ class Chain33Business
...
@@ -179,13 +178,12 @@ class Chain33Business
* @param integer $end
* @param integer $end
* @return array
* @return array
*/
*/
public
static
function
getBetStatus
(
$start
,
$end
,
$roundArr
=
[])
public
static
function
getBetStatus
(
$start
,
$end
,
$roundArr
=
[]
,
$node_params
=
[]
)
{
{
$node_params
=
\Yii
::
$app
->
params
[
'chain_parallel'
][
'wasm'
];
$service
=
new
Chain33Service
(
$node_params
);
$service
=
new
Chain33Service
(
$node_params
);
$execer
=
'wasm'
;
$execer
=
'wasm'
;
$funcName
=
'WasmGetContractTable'
;
$funcName
=
'WasmGetContractTable'
;
$contractName
=
'user.p.tschain.user.wasm.dice'
;
$contractName
=
$node_params
[
'contractName'
]
;
if
(
empty
(
$roundArr
))
{
if
(
empty
(
$roundArr
))
{
for
(
$i
=
$start
+
1
;
$i
<=
$end
;
$i
++
){
for
(
$i
=
$start
+
1
;
$i
<=
$end
;
$i
++
){
$items
[]
=
[
$items
[]
=
[
...
@@ -211,9 +209,8 @@ class Chain33Business
...
@@ -211,9 +209,8 @@ class Chain33Business
* @param null
* @param null
* @return array
* @return array
*/
*/
public
static
function
getLastHeader
()
public
static
function
getLastHeader
(
$node_params
=
[]
)
{
{
$node_params
=
\Yii
::
$app
->
params
[
'chain_parallel'
][
'wasm'
];
$service
=
new
Chain33Service
(
$node_params
);
$service
=
new
Chain33Service
(
$node_params
);
return
$service
->
getLastHeader
();
return
$service
->
getLastHeader
();
}
}
...
...
common/models/psources/CoinGameBet.php
View file @
726e5c9c
...
@@ -63,7 +63,7 @@ class CoinGameBet extends BaseActiveRecord
...
@@ -63,7 +63,7 @@ class CoinGameBet extends BaseActiveRecord
public
static
function
loadArray
(
array
$data
)
public
static
function
loadArray
(
array
$data
)
{
{
return
self
::
getDb
()
->
createCommand
()
->
batchInsert
(
self
::
tableName
(),
return
self
::
getDb
()
->
createCommand
()
->
batchInsert
(
self
::
tableName
(),
[
'round'
,
'player'
,
'amount'
,
'height'
,
'guess_num'
,
'rand_num'
,
'player_win'
],
[
'round'
,
'player'
,
'amount'
,
'height'
,
'guess_num'
,
'rand_num'
,
'player_win'
,
'platform'
],
$data
)
->
execute
();
$data
)
->
execute
();
}
}
}
}
common/models/pwallet/GameUserAddress.php
0 → 100644
View file @
726e5c9c
<?php
/**
* Created By Sublime text 3
* User: rlgyzhcn
* Date: 18-08-12
* Time: 下午14:17
*/
namespace
common\models\pwallet
;
use
common\core\BaseActiveRecord
;
use
Yii
;
class
GameUserAddress
extends
BaseActiveRecord
{
public
static
function
getDb
(){
return
Yii
::
$app
->
get
(
'db_pwallet'
);
}
public
function
formName
()
{
return
''
;
}
}
\ No newline at end of file
console/controllers/GameBetController.php
View file @
726e5c9c
...
@@ -16,90 +16,102 @@ class GameBetController extends Controller
...
@@ -16,90 +16,102 @@ class GameBetController extends Controller
*/
*/
public
function
actionGameStatus
()
public
function
actionGameStatus
()
{
{
$service
=
new
Chain33Business
();
$nodes
=
\Yii
::
$app
->
params
[
'chain_parallel'
][
'wasm'
];
$result
=
$service
->
getGameStatus
();
if
(
empty
(
$nodes
)){
if
(
0
!==
$result
[
'code'
]){
echo
date
(
'Y-m-d H:i:s'
)
.
'无节点'
.
PHP_EOL
;
echo
date
(
'Y-m-d H:i:s'
)
.
$result
[
'msg'
]
.
PHP_EOL
;
return
0
;
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'
]
??
[];
$queryResultItems
=
$result
[
'result'
]
??
[];
if
(
empty
(
$queryResultItems
))
{
if
(
empty
(
$queryResultItems
))
{
echo
date
(
'Y-m-d H:i:s'
)
.
'error'
.
PHP_EOL
;
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'error'
.
PHP_EOL
;
return
0
;
continue
;
}
}
$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_'
.
$key
);
if
(
empty
(
$cache_current_round
))
{
if
(
empty
(
$cache_current_round
))
{
$cache_current_round
=
CoinGameBet
::
find
(
)
->
max
(
'round'
);
$cache_current_round
=
CoinGameBet
::
find
()
->
where
([
'platform'
=>
$key
]
)
->
max
(
'round'
);
Yii
::
$app
->
redis
->
set
(
'chain33_game_bet_status'
,
$cache_current_round
,
'EX'
,
300
);
Yii
::
$app
->
redis
->
set
(
'chain33_game_bet_status_'
.
$key
,
$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
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据已为最新'
.
PHP_EOL
;
return
0
;
continue
;
}
}
Yii
::
$app
->
redis
->
set
(
'chain33_game_bet_status'
,
$current_round
,
'EX'
,
300
);
Yii
::
$app
->
redis
->
set
(
'chain33_game_bet_status_'
.
$key
,
$current_round
,
'EX'
,
300
);
$result
=
$service
->
getBetStatus
(
$cache_current_round
,
$current_round
);
$result
=
$service
->
getBetStatus
(
$cache_current_round
,
$current_round
,
''
,
$node
);
if
(
0
!==
$result
[
'code'
])
{
if
(
0
!==
$result
[
'code'
])
{
echo
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
return
0
;
continue
;
}
}
$queryResultItems
=
$result
[
'result'
]
??
[];
$queryResultItems
=
$result
[
'result'
]
??
[];
if
(
empty
(
$queryResultItems
))
{
if
(
empty
(
$queryResultItems
))
{
echo
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
return
0
;
continue
;
}
}
foreach
(
$queryResultItems
[
'queryResultItems'
]
as
$key
=>
$val
){
$platform
=
$key
;
if
(
false
==
$val
[
'found'
]
)
continue
;
foreach
(
$queryResultItems
[
'queryResultItems'
]
as
$key
=>
$val
)
{
$resultArr
=
json_decode
(
$val
[
'resultJSON'
],
true
);
if
(
false
==
$val
[
'found'
])
continue
;
$resultArr
=
json_decode
(
$val
[
'resultJSON'
],
true
);
$datas
[]
=
[
$datas
[]
=
[
$resultArr
[
'round'
],
$resultArr
[
'player'
],
$resultArr
[
'amount'
],
$resultArr
[
'height'
],
$resultArr
[
'guess_num'
],
$resultArr
[
'rand_num'
],
$resultArr
[
'player_win'
]
$resultArr
[
'round'
],
$resultArr
[
'player'
],
$resultArr
[
'amount'
],
$resultArr
[
'height'
],
$resultArr
[
'guess_num'
],
$resultArr
[
'rand_num'
],
$resultArr
[
'player_win'
],
$platform
];
];
}
}
CoinGameBet
::
loadArray
(
$datas
);
CoinGameBet
::
loadArray
(
$datas
);
echo
date
(
'Y-m-d H:i:s'
)
.
'数据更新成功'
.
PHP_EOL
;
echo
$platform
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据更新成功'
.
PHP_EOL
;
continue
;
}
return
0
;
return
0
;
}
}
public
function
actionBetUpdate
()
public
function
actionBetUpdate
()
{
{
$service
=
new
Chain33Business
();
$nodes
=
\Yii
::
$app
->
params
[
'chain_parallel'
][
'wasm'
];
$result
=
$service
->
getLastHeader
();
if
(
empty
(
$nodes
)){
$result
=
$result
[
'result'
]
??
[];
echo
date
(
'Y-m-d H:i:s'
)
.
'无节点'
.
PHP_EOL
;
if
(
empty
(
$result
)){
echo
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
return
0
;
return
0
;
}
}
$height
=
$result
[
'height'
];
foreach
(
$nodes
as
$key
=>
$node
)
{
$service
=
new
Chain33Business
();
$result
=
$service
->
getLastHeader
(
$node
);
$height
=
$result
[
'result'
][
'height'
];
$models
=
CoinGameBet
::
find
()
->
select
(
'round'
)
->
where
([
$models
=
CoinGameBet
::
find
()
->
select
(
'round'
)
->
where
([
'and'
,
'and'
,
[
'valid'
=>
CoinGameBet
::
VAILD_FALSE
],
[
'valid'
=>
CoinGameBet
::
VAILD_FALSE
],
[
'<'
,
'height'
,
$height
-
12
]
[
'<'
,
'height'
,
$height
-
12
],
[
'platform'
=>
$key
]
])
->
all
();
])
->
all
();
if
(
empty
(
$models
)){
if
(
empty
(
$models
)){
echo
date
(
'Y-m-d H:i:s'
)
.
'无需更新的数据'
.
PHP_EOL
;
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'无需更新的数据'
.
PHP_EOL
;
return
0
;
continue
;
}
}
$valid_arr
=
[];
$valid_arr
=
[];
foreach
(
$models
as
$model
)
{
foreach
(
$models
as
$model
)
{
$valid_arr
[]
=
$model
->
round
;
$valid_arr
[]
=
$model
->
round
;
}
}
$result
=
$service
->
getBetStatus
(
''
,
''
,
$valid_arr
);
$result
=
$service
->
getBetStatus
(
''
,
''
,
$valid_arr
,
$node
);
if
(
0
!==
$result
[
'code'
]){
if
(
0
!==
$result
[
'code'
]){
echo
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
return
0
;
continue
;
}
}
$queryResultItems
=
$result
[
'result'
]
??
[];
$queryResultItems
=
$result
[
'result'
]
??
[];
if
(
empty
(
$queryResultItems
)){
if
(
empty
(
$queryResultItems
)){
echo
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
echo
$key
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据错误'
.
PHP_EOL
;
return
0
;
continue
;
}
}
$platform
=
$key
;
foreach
(
$queryResultItems
[
'queryResultItems'
]
as
$key
=>
$val
){
foreach
(
$queryResultItems
[
'queryResultItems'
]
as
$key
=>
$val
){
if
(
false
==
$val
[
'found'
])
continue
;
if
(
false
==
$val
[
'found'
])
continue
;
$resultArr
=
json_decode
(
$val
[
'resultJSON'
],
true
);
$resultArr
=
json_decode
(
$val
[
'resultJSON'
],
true
);
...
@@ -111,10 +123,13 @@ class GameBetController extends Controller
...
@@ -111,10 +123,13 @@ class GameBetController extends Controller
'player_win'
=>
$resultArr
[
'player_win'
],
'player_win'
=>
$resultArr
[
'player_win'
],
'valid'
=>
CoinGameBet
::
VAILD_TRUE
'valid'
=>
CoinGameBet
::
VAILD_TRUE
],[
],[
'round'
=>
$resultArr
[
'round'
]
'round'
=>
$resultArr
[
'round'
],
'platform'
=>
$platform
]);
]);
}
}
echo
date
(
'Y-m-d H:i:s'
)
.
'数据更新成功'
.
PHP_EOL
;
echo
$platform
.
':'
.
date
(
'Y-m-d H:i:s'
)
.
'数据更新成功'
.
PHP_EOL
;
continue
;
}
return
0
;
return
0
;
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment