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
1906776e
Commit
1906776e
authored
Oct 18, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
余额查询
parent
5581b8b7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
WalletController.php
api/controllers/WalletController.php
+19
-13
No files found.
api/controllers/WalletController.php
View file @
1906776e
...
@@ -77,23 +77,28 @@ class WalletController extends BaseController
...
@@ -77,23 +77,28 @@ class WalletController extends BaseController
public
function
actionGetBalance
()
public
function
actionGetBalance
()
{
{
$coinAirDropTrade
=
CoinAirDropTrade
::
find
()
->
where
([
'balance'
=>
0
])
->
limit
(
60
)
->
all
();
$code
=
0
;
$address
=
[];
$msg
=
'success'
;
foreach
(
$coinAirDropTrade
as
$val
){
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
''
);
$address
[]
=
$val
->
coins_address
;
if
(
empty
(
$platform_id
)){
$msg
=
'参数不能为空'
;
$code
=
-
1
;
$data
=
null
;
goto
doEnd
;
}
}
$service
=
new
Chain33Service
();
$service
=
new
Chain33Service
();
$address
[]
=
'1Dqf6ADz6uCKitFhFqDY8TT93vafDADfEg'
;
$execer
=
'coins'
;
$execer
=
'coins'
;
$result
=
$service
->
getBalance
(
$address
,
$execer
);
$result
=
$service
->
getBalance
(
$address
,
$execer
);
if
(
0
==
$result
[
'code'
]){
if
(
0
!==
$result
[
'code'
]
&&
null
==
$result
[
'error'
])
{
$result_balance
=
$result
[
'result'
];
$msg
=
'查询错误'
;
foreach
(
$result_balance
as
$val
){
$code
=
-
1
;
$coinAirDropTrade
=
CoinAirDropTrade
::
find
()
->
where
([
'coins_address'
=>
$val
[
'addr'
]])
->
one
();
$data
=
null
;
if
(
empty
(
$coinAirDropTrade
))
continue
;
goto
doEnd
;
$coinAirDropTrade
->
balance
=
$val
[
'balance'
];
$coinAirDropTrade
->
save
();
}
}
}
return
[
'code'
=>
1
,
'msg'
=>
'ok'
];
$data
=
$result
[
'result'
];
doEnd
:
return
[
'code'
=>
$code
,
'data'
=>
$data
,
'msg'
=>
$msg
];
}
}
}
}
\ 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