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
24e10c74
Commit
24e10c74
authored
Jun 10, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抓取投注数据时间调整
parent
b317e2de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
ServiceController.php
api/controllers/ServiceController.php
+4
-0
Chain33Business.php
common/business/Chain33Business.php
+2
-2
GameBetController.php
console/controllers/GameBetController.php
+3
-3
GameBet.sh
shell/GameBet.sh
+3
-0
No files found.
api/controllers/ServiceController.php
View file @
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'
=>
'币种列表获取成功'
];
}
...
...
common/business/Chain33Business.php
View file @
24e10c74
...
...
@@ -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'
,
...
...
console/controllers/GameBetController.php
View file @
24e10c74
...
...
@@ -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
;
...
...
shell/GameBet.sh
0 → 100644
View file @
24e10c74
#!/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
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