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
dbc900ff
Commit
dbc900ff
authored
Jan 02, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/issue_coin' into 'master'
Feature/issue coin See merge request
!259
parents
f6fa15ea
39960b09
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
20 deletions
+8
-20
IssueCoinController.php
api/controllers/IssueCoinController.php
+2
-2
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+2
-14
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+2
-2
IssueCoinController.php
wallet/controllers/IssueCoinController.php
+2
-2
No files found.
api/controllers/IssueCoinController.php
View file @
dbc900ff
...
...
@@ -193,7 +193,7 @@ class IssueCoinController extends BaseController
$pages
=
new
Pagination
([
'totalCount'
=>
$countQuery
->
count
(),
'pageSize'
=>
$size
]);
foreach
(
$models
as
&
$val
)
{
$val
->
chain_id
=
$val
->
chain
->
platform
;
$val
->
total
=
(
int
)
$val
->
total
*
1e
8
;
$val
->
total
=
(
int
)
$val
->
total
*
1e
4
;
}
$data
=
[
'list'
=>
$models
,
...
...
@@ -231,7 +231,7 @@ class IssueCoinController extends BaseController
$code
=
-
1
;
goto
doEnd
;
}
$data
->
total
=
(
int
)
$data
->
total
*
1e
8
;
$data
->
total
=
(
int
)
$data
->
total
*
1e
4
;
$data
->
chain_name
=
$data
->
chain
->
platform
;
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$code
=
0
;
...
...
common/models/psources/CoinIssueCoin.php
View file @
dbc900ff
...
...
@@ -129,14 +129,14 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
verfiyAmount
(
$attribute
,
$params
)
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$this
->
type
)
{
if
(
$this
->
$attribute
>
10
)
{
if
(
$this
->
$attribute
>
(
10
*
1e4
)
)
{
$this
->
addError
(
$attribute
,
'增发发行量不能超过10亿'
);
return
false
;
}
}
$issue_record
=
CoinIssueCoin
::
find
()
->
where
([
'platform_id'
=>
$this
->
platform_id
,
'symbol'
=>
$this
->
symbol
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
sum
(
'total'
);
$issue_record
=
empty
(
$issue_record
)
?
0
:
$issue_record
;
if
(
$issue_record
+
$this
->
$attribute
>
900
)
{
if
(
$issue_record
+
$this
->
$attribute
>
(
900
*
1e4
)
)
{
$this
->
addError
(
$attribute
,
'最大发行量900亿,目前已发行'
.
$issue_record
.
'亿'
);
return
false
;
}
...
...
@@ -163,18 +163,6 @@ class CoinIssueCoin extends CommonActiveRecord
return
array_merge
(
parent
::
attributes
(),
[
'issue_charge'
,
'url'
,
'chain_name'
]);
}
/**
* 获取状态数组
* @return array
*/
public
static
function
getAgentStatus
()
{
return
[
self
::
STATUS_SUCCESS
=>
'发行成功'
,
self
::
STATUS_FAIL
=>
'发行失败'
,
];
}
public
function
getChain
()
{
return
$this
->
hasOne
(
CoinPlatformWithHold
::
className
(),
[
'id'
=>
'chain_id'
]);
...
...
console/controllers/IssueChainTransferController.php
View file @
dbc900ff
...
...
@@ -369,12 +369,12 @@ class IssueChainTransferController extends Controller
$model
->
sid
=
$params
[
'name'
];
$model
->
nickname
=
[
'ja'
=>
''
,
'en-US'
=>
''
,
'zh-CN'
=>
''
];
$model
->
platform
=
$params
[
'platform'
];
$model
->
publish_count
=
$params
[
'total'
]
*
1e
8
;
$model
->
publish_count
=
$params
[
'total'
]
*
1e
4
;
$model
->
chain
=
'BTY'
;
$model
->
treaty
=
1
;
$model
->
save
();
}
else
{
$model_coin
->
publish_count
=
$model_coin
->
publish_count
+
$params
[
'total'
]
*
1e
8
;
$model_coin
->
publish_count
=
$model_coin
->
publish_count
+
$params
[
'total'
]
*
1e
4
;
$model_coin
->
save
();
}
}
...
...
wallet/controllers/IssueCoinController.php
View file @
dbc900ff
...
...
@@ -61,7 +61,7 @@ class IssueCoinController extends BaseController
$platform
=
isset
(
$val
->
chain
->
platform
)
?
$val
->
chain
->
platform
:
''
;
$val
->
chain_name
=
$platform
;
$val
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$val
->
total
=
(
int
)
$val
->
total
*
1e
8
;
$val
->
total
=
(
int
)
$val
->
total
*
1e
4
;
}
$data
=
[
'list'
=>
$models
,
...
...
@@ -95,7 +95,7 @@ class IssueCoinController extends BaseController
$data
=
CoinIssueCoin
::
find
()
->
where
([
'id'
=>
$id
])
->
one
();
$platform
=
isset
(
$data
->
chain
->
platform
)
?
$data
->
chain
->
platform
:
''
;
$data
->
total
=
(
int
)
$data
->
total
*
1e
8
;
$data
->
total
=
(
int
)
$data
->
total
*
1e
4
;
$data
->
issue_charge
=
rtrim
(
sprintf
(
'%.3f'
,
floatval
(
$data
->
charge
)),
'0'
);
$data
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$code
=
0
;
...
...
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