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
61a5fbe4
Commit
61a5fbe4
authored
Nov 26, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
cdc890c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
32 deletions
+37
-32
IssueChainController.php
wallet/controllers/IssueChainController.php
+37
-32
No files found.
wallet/controllers/IssueChainController.php
View file @
61a5fbe4
...
...
@@ -100,26 +100,27 @@ class IssueChainController extends BaseController
public
function
actionSetCharge
()
{
$data
=
null
;
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
$result
=
Yii
::
$app
->
request
->
post
();
$group
=
Yii
::
$app
->
request
->
getGroup
();
if
(
'administrator'
==
$group
)
{
$platform_id
=
isset
(
$result
[
'platform_id'
])
?
(
int
)
$result
[
'platform_id'
]
:
0
;
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
}
$issue_charge
=
isset
(
$result
[
'issue_charge'
])
?
$result
[
'issue_charge'
]
:
''
;
$charge_unit
=
isset
(
$result
[
'charge_unit'
])
?
strtoupper
(
$result
[
'charge_unit'
])
:
''
;
$id
=
isset
(
$result
[
'platform_id'
])
?
(
int
)
$result
[
'platform_id'
]
:
0
;
if
(
false
==
$issue_charge
||
false
==
$charge_unit
)
{
if
(
false
==
$issue_charge
||
false
==
$charge_unit
||
false
==
$platform_id
)
{
$msg
=
'提交数据有误'
;
$code
=
-
1
;
goto
doEnd
;
}
if
(
1
==
$platform_id
)
{
$platform_id
=
$id
;
}
$chain_model
=
CoinPlatform
::
find
()
->
where
([
'id'
=>
$platform_id
])
->
one
();
if
(
false
==
$chain_model
)
{
$msg
=
'
不存在的链
'
;
$msg
=
'
数据不存在
'
;
$code
=
-
1
;
goto
doEnd
;
}
...
...
@@ -146,8 +147,8 @@ class IssueChainController extends BaseController
public
function
actionManageReview
()
{
$data
=
null
;
$
platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
if
(
1
!=
$platform_id
)
{
$
group
=
Yii
::
$app
->
request
->
getGroup
();
if
(
'administrator'
==
$group
)
{
$msg
=
'当前账户无权限操作'
;
$code
=
-
1
;
goto
doEnd
;
...
...
@@ -176,34 +177,38 @@ class IssueChainController extends BaseController
{
$data
=
null
;
$group
=
Yii
::
$app
->
request
->
getGroup
();
// if ('administrator' == $group) {
// $chains = array_keys(Yii::$app->params['chain_nodes']);
// $platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['in', 'platform', $chains])->all();
// } else {
// $platform_id = Yii::$app->request->getPlatformId();
// $chain_model = CoinPlatform::find()->select('chain_id')->where(['id' => $platform_id])->andWhere(['<>', 'chain_id', 0])->one();
// $platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['id' => $chain_model->chain_id])->all();
// }
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
$chain_model
=
CoinPlatform
::
find
()
->
select
(
'chain_id'
)
->
where
([
'id'
=>
$platform_id
])
->
andWhere
([
'<>'
,
'chain_id'
,
0
])
->
one
();
if
(
empty
(
$chain_model
))
{
$msg
=
'此功能为付费功能,有兴趣请与销售联系'
;
$code
=
-
1
;
goto
doEnd
;
}
$platform
=
CoinPlatformWithHold
::
find
()
->
select
(
'id, platform, exer'
)
->
where
([
'id'
=>
$chain_model
->
chain_id
])
->
all
();
if
(
empty
(
$platform
))
{
$msg
=
'此功能为付费功能,有兴趣请与销售联系'
;
$code
=
-
1
;
goto
doEnd
;
if
(
'administrator'
==
$group
)
{
$chains
=
array_keys
(
Yii
::
$app
->
params
[
'chain_nodes'
]);
$platform
=
CoinPlatformWithHold
::
find
()
->
select
(
'id, platform, exer'
)
->
where
([
'in'
,
'platform'
,
$chains
])
->
all
();
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
$chain_model
=
CoinPlatform
::
find
()
->
select
(
'chain_id'
)
->
where
([
'id'
=>
$platform_id
])
->
andWhere
([
'<>'
,
'chain_id'
,
0
])
->
one
();
if
(
empty
(
$chain_model
))
{
$msg
=
'尚未开通此功能'
;
$code
=
-
1
;
goto
doEnd
;
}
$platform
=
CoinPlatformWithHold
::
find
()
->
select
(
'id, platform, exer'
)
->
where
([
'id'
=>
$chain_model
->
chain_id
])
->
one
();
if
(
empty
(
$platform
))
{
$msg
=
'尚未开通此功能'
;
$code
=
-
1
;
goto
doEnd
;
}
if
(
!
isset
(
Yii
::
$app
->
params
[
'chain_nodes'
][
strtoupper
(
$platform
->
platform
)]))
{
$msg
=
'尚未开通此功能'
;
$code
=
-
1
;
goto
doEnd
;
}
$platform
=
array
(
$platform
);
}
foreach
(
$platform
as
$val
)
{
$val
->
tokens
=
[];
if
(
!
empty
(
$val
->
exer
))
{
$node
=
Yii
::
$app
->
params
[
'chain_nodes'
][
strtoupper
(
$val
->
platform
)];
$service
=
new
Chain33Service
(
$node
);
$funcName
=
'GetTokens'
;
$result
=
$service
->
getTokens
(
$val
->
exer
,
$funcName
);
$result
=
$service
->
getTokens
(
$val
->
exer
,
$funcName
);
if
(
isset
(
$result
[
'code'
])
&&
0
==
$result
[
'code'
])
{
$symbol
=
[];
foreach
(
$result
[
'result'
][
'tokens'
]
as
$temp
)
{
...
...
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