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
2a4156b6
Commit
2a4156b6
authored
Nov 14, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
eba58e9b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+26
-13
No files found.
common/models/psources/CoinIssueCoin.php
View file @
2a4156b6
...
@@ -71,39 +71,51 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -71,39 +71,51 @@ class CoinIssueCoin extends CommonActiveRecord
public
function
verfiyName
(
$attribute
,
$params
)
public
function
verfiyName
(
$attribute
,
$params
)
{
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$this
->
type
)
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$this
->
type
)
{
return
true
;
$model
=
CoinIssueCoin
::
find
()
->
where
([
'name'
=>
$this
->
name
,
'owner'
=>
$this
->
owner
,
'platform_id'
=>
$this
->
platform_id
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
orderBy
(
'id desc'
)
->
one
();
}
$model
=
CoinIssueCoin
::
find
()
->
where
([
'name'
=>
$this
->
name
,
'owner'
=>
$this
->
owner
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
orderBy
(
'id desc'
)
->
one
();
if
(
false
==
$model
)
{
if
(
false
==
$model
)
{
return
true
;
$this
->
addError
(
$attribute
,
'该Token币种尚未发行'
);
return
false
;
}
}
if
(
0
==
$model
->
category
)
{
if
(
0
==
$model
->
category
)
{
$this
->
addError
(
$attribute
,
'名称已存在
'
);
$this
->
addError
(
$attribute
,
'该Token币种不可增发
'
);
return
false
;
return
false
;
}
}
}
}
if
(
CoinIssueCoin
::
TYPE_NO
==
$this
->
type
)
{
$model
=
CoinIssueCoin
::
find
()
->
where
([
'name'
=>
$this
->
name
,
'owner'
=>
$this
->
owner
,
'platform_id'
=>
$this
->
platform_id
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
orderBy
(
'id desc'
)
->
one
();
if
(
$model
)
{
$this
->
addError
(
$attribute
,
'Token名称已存在'
);
return
false
;
}
}
}
public
function
verfiySymbol
(
$attribute
,
$params
)
public
function
verfiySymbol
(
$attribute
,
$params
)
{
{
if
(
!
preg_match
(
'/^[A-Z]+$/'
,
$this
->
symbol
))
{
if
(
!
preg_match
(
'/^[A-Z]+$/'
,
$this
->
symbol
))
{
$this
->
addError
(
$attribute
,
'
名
称必须大写'
);
$this
->
addError
(
$attribute
,
'
Token简
称必须大写'
);
return
false
;
return
false
;
}
}
if
(
CoinIssueCoin
::
TYPE_YES
==
$this
->
type
)
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$this
->
type
)
{
return
true
;
$model
=
CoinIssueCoin
::
find
()
->
where
([
'symbol'
=>
$this
->
symbol
,
'owner'
=>
$this
->
owner
,
'platform_id'
=>
$this
->
platform_id
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
orderBy
(
'id desc'
)
->
one
();
}
$model
=
CoinIssueCoin
::
find
()
->
where
([
'symbol'
=>
$this
->
symbol
,
'owner'
=>
$this
->
owner
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
orderBy
(
'id desc'
)
->
one
();
if
(
false
==
$model
)
{
if
(
false
==
$model
)
{
return
true
;
$this
->
addError
(
$attribute
,
'该Token币种尚未发行'
);
return
false
;
}
}
if
(
0
==
$model
->
category
)
{
if
(
0
==
$model
->
category
)
{
$this
->
addError
(
$attribute
,
'名称已存在'
);
$this
->
addError
(
$attribute
,
'该Token币种不可增发'
);
return
false
;
}
}
if
(
CoinIssueCoin
::
TYPE_NO
==
$this
->
type
)
{
$model
=
CoinIssueCoin
::
find
()
->
where
([
'symbol'
=>
$this
->
symbol
,
'owner'
=>
$this
->
owner
,
'platform_id'
=>
$this
->
platform_id
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
orderBy
(
'id desc'
)
->
one
();
if
(
$model
)
{
$this
->
addError
(
$attribute
,
'Token名称已存在'
);
return
false
;
return
false
;
}
}
}
}
}
public
function
verfiyAmount
(
$attribute
,
$params
)
public
function
verfiyAmount
(
$attribute
,
$params
)
{
{
...
@@ -173,6 +185,7 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -173,6 +185,7 @@ class CoinIssueCoin extends CommonActiveRecord
{
{
return
$this
->
hasOne
(
CoinIssueChainRecord
::
className
(),
[
'issue_coin_id'
=>
'id'
]);
return
$this
->
hasOne
(
CoinIssueChainRecord
::
className
(),
[
'issue_coin_id'
=>
'id'
]);
}
}
public
function
getRevoke
()
public
function
getRevoke
()
{
{
return
$this
->
hasOne
(
CoinIssueRevokeRecord
::
className
(),
[
'issue_coin_id'
=>
'id'
]);
return
$this
->
hasOne
(
CoinIssueRevokeRecord
::
className
(),
[
'issue_coin_id'
=>
'id'
]);
...
...
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