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
b3a998ad
Commit
b3a998ad
authored
Oct 14, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
申请规则调整
parent
3357b8de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
IssueCoinController.php
api/controllers/IssueCoinController.php
+1
-2
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+5
-6
No files found.
api/controllers/IssueCoinController.php
View file @
b3a998ad
...
...
@@ -45,7 +45,6 @@ class IssueCoinController extends BaseController
'symbol'
=>
isset
(
$result
[
'symbol'
])
?
strtoupper
(
$result
[
'symbol'
])
:
''
,
'total'
=>
isset
(
$result
[
'total'
])
?
$result
[
'total'
]
:
''
,
'owner'
=>
isset
(
$result
[
'owner'
])
?
$result
[
'owner'
]
:
''
,
'url'
=>
isset
(
$result
[
'url'
])
?
$result
[
'url'
]
:
''
,
'introduction'
=>
isset
(
$result
[
'introduction'
])
?
$result
[
'introduction'
]
:
''
,
'category'
=>
isset
(
$result
[
'category'
])
?
$result
[
'category'
]
:
0
,
'platform_id'
=>
$platform_id
,
...
...
@@ -54,7 +53,7 @@ class IssueCoinController extends BaseController
];
$model
->
load
(
$result
,
''
);
if
(
!
$model
->
save
())
{
$msg
=
current
(
$model
->
firstErrors
)
;
$msg
=
$model
->
errors
;
$code
=
-
1
;
goto
doEnd
;
}
...
...
common/models/psources/CoinIssueCoin.php
View file @
b3a998ad
...
...
@@ -35,7 +35,7 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
rules
()
{
return
[
[[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'
url'
,
'
introduction'
,
'category'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
'required'
],
[[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
'required'
],
[[
'total'
,
'category'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
'integer'
],
[
'introduction'
,
'string'
,
'length'
=>
[
1
,
20
]],
[
'symbol'
,
'string'
,
'length'
=>
[
1
,
20
]],
...
...
@@ -43,7 +43,6 @@ class CoinIssueCoin extends CommonActiveRecord
[
'name'
,
'string'
,
'length'
=>
[
1
,
6
]],
#['status', 'in', 'range' => [1, 2, 0]],
[
'symbol'
,
'unique'
],
[
'url'
,
'url'
],
[
'total'
,
'verfiyAmount'
]
];
}
...
...
@@ -53,14 +52,15 @@ class CoinIssueCoin extends CommonActiveRecord
$issue_record
=
CoinIssueRecord
::
find
()
->
where
([
'platform_id'
=>
$this
->
platform_id
])
->
sum
(
'total'
);
$issue_record
=
empty
(
$issue_record
)
?
0
:
$issue_record
;
if
(
$issue_record
+
$this
->
$attribute
>=
900
)
{
$this
->
addError
(
$this
->
$attribute
,
'最大发行量900亿,目前已发行'
.
$issue_record
.
'亿'
);
$this
->
addError
(
$attribute
,
'最大发行量900亿,目前已发行'
.
$issue_record
.
'亿'
);
return
false
;
}
}
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'platform_id'
,
'chain_id'
,
'
url'
,
'
charge_unit_id'
],
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
self
::
SCENARIOS_UPDATE
=>
[
'status'
,
'msg'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
];
...
...
@@ -80,13 +80,12 @@ class CoinIssueCoin extends CommonActiveRecord
'msg'
=>
'失败原因'
,
'status'
=>
'状态'
,
'charge_unit_id'
=>
'手续费'
,
'url'
=>
'浏览器地址'
];
}
public
function
attributes
()
{
return
array_merge
(
parent
::
attributes
(),
[
'charge'
,
'charge_unit'
]);
return
array_merge
(
parent
::
attributes
(),
[
'charge'
,
'charge_unit'
,
'url'
]);
}
/**
...
...
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