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
f928ae53
Commit
f928ae53
authored
Nov 25, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d75af376
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
IssueCoinController.php
api/controllers/IssueCoinController.php
+2
-3
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+6
-6
IssueCoinController.php
wallet/controllers/IssueCoinController.php
+2
-4
No files found.
api/controllers/IssueCoinController.php
View file @
f928ae53
...
...
@@ -52,7 +52,7 @@ class IssueCoinController extends BaseController
'type'
=>
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
0
,
'platform_id'
=>
$platform_id
,
'chain_id'
=>
$chain_id
,
'charge_unit
_id'
=>
isset
(
$result
[
'charge_unit_id'
])
?
$result
[
'charge_unit_id
'
]
:
''
,
'charge_unit
'
=>
isset
(
$result
[
'charge_unit'
])
?
$result
[
'charge_unit
'
]
:
''
,
'charge'
=>
$coin_platform
->
issue_charge
,
];
$model
=
new
CoinIssueCoin
();
...
...
@@ -129,7 +129,7 @@ class IssueCoinController extends BaseController
'type'
=>
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
0
,
'platform_id'
=>
$platform_id
,
'chain_id'
=>
$chain_id
,
'charge_unit
_id'
=>
isset
(
$result
[
'charge_unit_id'
])
?
$result
[
'charge_unit_id
'
]
:
''
,
'charge_unit
'
=>
isset
(
$result
[
'charge_unit'
])
?
$result
[
'charge_unit
'
]
:
''
,
'charge'
=>
$coin_platform
->
issue_charge
,
];
$model
->
load
(
$result
,
''
);
...
...
@@ -234,7 +234,6 @@ class IssueCoinController extends BaseController
$data
->
total
=
(
int
)
$data
->
total
*
1e8
;
$data
->
chain_name
=
$data
->
chain
->
platform
;
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$data
->
charge_unit
=
isset
(
$data
->
platform
->
charge_unit
)
?
$data
->
platform
->
charge_unit
:
''
;
$code
=
0
;
$msg
=
'success'
;
if
(
CoinIssueCoin
::
STATUS_FAILED
==
$data
->
status
)
{
...
...
common/models/psources/CoinIssueCoin.php
View file @
f928ae53
...
...
@@ -46,9 +46,9 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
rules
()
{
return
[
[[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit
_id
'
,
'charge'
],
'required'
],
[[
'total'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
'integer'
],
[
'introduction'
,
'string'
,
'length'
=>
[
1
,
20
]],
[[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit'
,
'charge'
],
'required'
],
[[
'total'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
],
'integer'
],
[
[
'introduction'
,
'charge_unit'
]
,
'string'
,
'length'
=>
[
1
,
20
]],
[
'symbol'
,
'string'
,
'length'
=>
[
1
,
6
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
20
]],
#['status', 'in', 'range' => [1, 2, 0]],
...
...
@@ -61,7 +61,7 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit
_id
'
,
'charge'
],
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit'
,
'charge'
],
self
::
SCENARIOS_UPDATE
=>
[
'status'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
];
...
...
@@ -148,13 +148,13 @@ class CoinIssueCoin extends CommonActiveRecord
'chain_id'
=>
'平行链名称'
,
'msg'
=>
'失败原因'
,
'status'
=>
'状态'
,
'charge_unit
_id
'
=>
'手续费'
,
'charge_unit'
=>
'手续费'
,
];
}
public
function
attributes
()
{
return
array_merge
(
parent
::
attributes
(),
[
'issue_charge'
,
'
charge_unit'
,
'
url'
,
'chain_name'
]);
return
array_merge
(
parent
::
attributes
(),
[
'issue_charge'
,
'url'
,
'chain_name'
]);
}
/**
...
...
wallet/controllers/IssueCoinController.php
View file @
f928ae53
...
...
@@ -29,12 +29,12 @@ class IssueCoinController extends BaseController
$chain_id
=
\Yii
::
$app
->
request
->
get
(
'chain_id'
,
''
);
if
(
1
==
$platform_id
)
{
$query
=
CoinIssueCoin
::
find
()
->
select
(
'id, name, total, status, chain_id, charge_unit
_id
, charge, platform_id, owner, category, type, symbol, introduction, create_time'
)
->
select
(
'id, name, total, status, chain_id, charge_unit, charge, platform_id, owner, category, type, symbol, introduction, create_time'
)
->
where
([
'in'
,
'status'
,
[
CoinIssueCoin
::
STATUS_CONFIRM
,
CoinIssueCoin
::
STATUS_ALLOW
,
CoinIssueCoin
::
STATUS_REFUSE
,
CoinIssueCoin
::
STATUS_SUCCESS
,
CoinIssueCoin
::
STATUS_FAILED
]])
->
orderBy
(
'create_time desc'
);
}
else
{
$query
=
CoinIssueCoin
::
find
()
->
select
(
'id, name, total, status, chain_id, charge_unit
_id
, charge, platform_id, owner, category, type, symbol, introduction, create_time'
)
->
select
(
'id, name, total, status, chain_id, charge_unit, charge, platform_id, owner, category, type, symbol, introduction, create_time'
)
->
where
([
'platform_id'
=>
$platform_id
])
->
andWhere
([
'in'
,
'status'
,
[
CoinIssueCoin
::
STATUS_CONFIRM
,
CoinIssueCoin
::
STATUS_ALLOW
,
CoinIssueCoin
::
STATUS_REFUSE
,
CoinIssueCoin
::
STATUS_SUCCESS
,
CoinIssueCoin
::
STATUS_FAILED
]])
->
orderBy
(
'create_time desc'
);
...
...
@@ -60,7 +60,6 @@ class IssueCoinController extends BaseController
foreach
(
$models
as
&
$val
)
{
$platform
=
isset
(
$val
->
chain
->
platform
)
?
$val
->
chain
->
platform
:
''
;
$val
->
chain_name
=
$platform
;
$val
->
charge_unit
=
isset
(
$val
->
gas
->
coin_name
)
?
$val
->
gas
->
coin_name
:
''
;
$val
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$val
->
total
=
(
int
)
$val
->
total
*
1e8
;
}
...
...
@@ -98,7 +97,6 @@ class IssueCoinController extends BaseController
$platform
=
isset
(
$data
->
chain
->
platform
)
?
$data
->
chain
->
platform
:
''
;
$data
->
total
=
(
int
)
$data
->
total
*
1e8
;
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$data
->
charge_unit
=
isset
(
$data
->
gas
->
coin_name
)
?
$data
->
gas
->
coin_name
:
''
;
$data
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$code
=
0
;
$msg
=
'success'
;
...
...
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