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
Hide 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
...
@@ -52,7 +52,7 @@ class IssueCoinController extends BaseController
'type'
=>
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
0
,
'type'
=>
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
0
,
'platform_id'
=>
$platform_id
,
'platform_id'
=>
$platform_id
,
'chain_id'
=>
$chain_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
,
'charge'
=>
$coin_platform
->
issue_charge
,
];
];
$model
=
new
CoinIssueCoin
();
$model
=
new
CoinIssueCoin
();
...
@@ -129,7 +129,7 @@ class IssueCoinController extends BaseController
...
@@ -129,7 +129,7 @@ class IssueCoinController extends BaseController
'type'
=>
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
0
,
'type'
=>
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
0
,
'platform_id'
=>
$platform_id
,
'platform_id'
=>
$platform_id
,
'chain_id'
=>
$chain_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
,
'charge'
=>
$coin_platform
->
issue_charge
,
];
];
$model
->
load
(
$result
,
''
);
$model
->
load
(
$result
,
''
);
...
@@ -234,7 +234,6 @@ class IssueCoinController extends BaseController
...
@@ -234,7 +234,6 @@ class IssueCoinController extends BaseController
$data
->
total
=
(
int
)
$data
->
total
*
1e8
;
$data
->
total
=
(
int
)
$data
->
total
*
1e8
;
$data
->
chain_name
=
$data
->
chain
->
platform
;
$data
->
chain_name
=
$data
->
chain
->
platform
;
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$data
->
charge_unit
=
isset
(
$data
->
platform
->
charge_unit
)
?
$data
->
platform
->
charge_unit
:
''
;
$code
=
0
;
$code
=
0
;
$msg
=
'success'
;
$msg
=
'success'
;
if
(
CoinIssueCoin
::
STATUS_FAILED
==
$data
->
status
)
{
if
(
CoinIssueCoin
::
STATUS_FAILED
==
$data
->
status
)
{
...
...
common/models/psources/CoinIssueCoin.php
View file @
f928ae53
...
@@ -46,9 +46,9 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -46,9 +46,9 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit
_id
'
,
'charge'
],
'required'
],
[[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit'
,
'charge'
],
'required'
],
[[
'total'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
'integer'
],
[[
'total'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
],
'integer'
],
[
'introduction'
,
'string'
,
'length'
=>
[
1
,
20
]],
[
[
'introduction'
,
'charge_unit'
]
,
'string'
,
'length'
=>
[
1
,
20
]],
[
'symbol'
,
'string'
,
'length'
=>
[
1
,
6
]],
[
'symbol'
,
'string'
,
'length'
=>
[
1
,
6
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
20
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
20
]],
#['status', 'in', 'range' => [1, 2, 0]],
#['status', 'in', 'range' => [1, 2, 0]],
...
@@ -61,7 +61,7 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -61,7 +61,7 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
scenarios
()
public
function
scenarios
()
{
{
$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_UPDATE
=>
[
'status'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
];
];
...
@@ -148,13 +148,13 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -148,13 +148,13 @@ class CoinIssueCoin extends CommonActiveRecord
'chain_id'
=>
'平行链名称'
,
'chain_id'
=>
'平行链名称'
,
'msg'
=>
'失败原因'
,
'msg'
=>
'失败原因'
,
'status'
=>
'状态'
,
'status'
=>
'状态'
,
'charge_unit
_id
'
=>
'手续费'
,
'charge_unit'
=>
'手续费'
,
];
];
}
}
public
function
attributes
()
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
...
@@ -29,12 +29,12 @@ class IssueCoinController extends BaseController
$chain_id
=
\Yii
::
$app
->
request
->
get
(
'chain_id'
,
''
);
$chain_id
=
\Yii
::
$app
->
request
->
get
(
'chain_id'
,
''
);
if
(
1
==
$platform_id
)
{
if
(
1
==
$platform_id
)
{
$query
=
CoinIssueCoin
::
find
()
$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
]])
->
where
([
'in'
,
'status'
,
[
CoinIssueCoin
::
STATUS_CONFIRM
,
CoinIssueCoin
::
STATUS_ALLOW
,
CoinIssueCoin
::
STATUS_REFUSE
,
CoinIssueCoin
::
STATUS_SUCCESS
,
CoinIssueCoin
::
STATUS_FAILED
]])
->
orderBy
(
'create_time desc'
);
->
orderBy
(
'create_time desc'
);
}
else
{
}
else
{
$query
=
CoinIssueCoin
::
find
()
$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
])
->
where
([
'platform_id'
=>
$platform_id
])
->
andWhere
([
'in'
,
'status'
,
[
CoinIssueCoin
::
STATUS_CONFIRM
,
CoinIssueCoin
::
STATUS_ALLOW
,
CoinIssueCoin
::
STATUS_REFUSE
,
CoinIssueCoin
::
STATUS_SUCCESS
,
CoinIssueCoin
::
STATUS_FAILED
]])
->
andWhere
([
'in'
,
'status'
,
[
CoinIssueCoin
::
STATUS_CONFIRM
,
CoinIssueCoin
::
STATUS_ALLOW
,
CoinIssueCoin
::
STATUS_REFUSE
,
CoinIssueCoin
::
STATUS_SUCCESS
,
CoinIssueCoin
::
STATUS_FAILED
]])
->
orderBy
(
'create_time desc'
);
->
orderBy
(
'create_time desc'
);
...
@@ -60,7 +60,6 @@ class IssueCoinController extends BaseController
...
@@ -60,7 +60,6 @@ class IssueCoinController extends BaseController
foreach
(
$models
as
&
$val
)
{
foreach
(
$models
as
&
$val
)
{
$platform
=
isset
(
$val
->
chain
->
platform
)
?
$val
->
chain
->
platform
:
''
;
$platform
=
isset
(
$val
->
chain
->
platform
)
?
$val
->
chain
->
platform
:
''
;
$val
->
chain_name
=
$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
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$val
->
total
=
(
int
)
$val
->
total
*
1e8
;
$val
->
total
=
(
int
)
$val
->
total
*
1e8
;
}
}
...
@@ -98,7 +97,6 @@ class IssueCoinController extends BaseController
...
@@ -98,7 +97,6 @@ class IssueCoinController extends BaseController
$platform
=
isset
(
$data
->
chain
->
platform
)
?
$data
->
chain
->
platform
:
''
;
$platform
=
isset
(
$data
->
chain
->
platform
)
?
$data
->
chain
->
platform
:
''
;
$data
->
total
=
(
int
)
$data
->
total
*
1e8
;
$data
->
total
=
(
int
)
$data
->
total
*
1e8
;
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$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
);
$data
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$code
=
0
;
$code
=
0
;
$msg
=
'success'
;
$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