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
5b6cd578
Commit
5b6cd578
authored
Jan 11, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/issue_coin' into develop
parents
5af21697
8a4de379
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
IssueCoinController.php
api/controllers/IssueCoinController.php
+18
-7
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+2
-0
No files found.
api/controllers/IssueCoinController.php
View file @
5b6cd578
...
@@ -59,13 +59,18 @@ class IssueCoinController extends BaseController
...
@@ -59,13 +59,18 @@ class IssueCoinController extends BaseController
'nickname'
=>
isset
(
$result
[
'nickname'
])
?
$result
[
'nickname'
]
:
''
'nickname'
=>
isset
(
$result
[
'nickname'
])
?
$result
[
'nickname'
]
:
''
];
];
$model
=
new
CoinIssueCoin
();
$model
=
new
CoinIssueCoin
();
if
(
!
in_array
(
$params
[
'token_type'
],
[
0
,
1
,
2
]))
{
if
(
0
==
$params
[
'token_type'
]){
$params
[
'template'
]
=
isset
(
$result
[
'template'
])
?
$result
[
'template'
]
:
[];
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_VERIFY_MALL
);
}
else
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
}
}
if
(
in_array
(
$params
[
'token_type'
],
[
1
,
2
])){
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_NO_CHARGE
);
}
if
(
in_array
(
$params
[
'token_type'
],
[
3
,
4
])){
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_VERIFY_MALL
);
}
$model
->
load
(
$params
,
''
);
$model
->
load
(
$params
,
''
);
if
(
!
$model
->
validate
())
{
if
(
!
$model
->
validate
())
{
$msg
=
$model
->
errors
;
$msg
=
$model
->
errors
;
...
@@ -141,12 +146,18 @@ class IssueCoinController extends BaseController
...
@@ -141,12 +146,18 @@ class IssueCoinController extends BaseController
];
];
$model
=
new
CoinIssueCoin
();
$model
=
new
CoinIssueCoin
();
if
(
!
in_array
(
$params
[
'token_type'
],
[
0
,
1
,
2
]))
{
if
(
0
==
$params
[
'token_type'
]){
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE_MALL
);
}
else
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
}
}
if
(
in_array
(
$params
[
'token_type'
],
[
1
,
2
])){
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_NO_CHARGE
);
}
if
(
in_array
(
$params
[
'token_type'
],
[
3
,
4
])){
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_VERIFY_MALL
);
}
$model
->
load
(
$result
,
''
);
$model
->
load
(
$result
,
''
);
if
(
!
$model
->
save
())
{
if
(
!
$model
->
save
())
{
...
...
common/models/psources/CoinIssueCoin.php
View file @
5b6cd578
...
@@ -32,6 +32,7 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -32,6 +32,7 @@ class CoinIssueCoin extends CommonActiveRecord
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_UPDATE
=
'update'
;
const
SCENARIOS_UPDATE
=
'update'
;
const
SCENARIOS_CANCEL
=
'cancel'
;
const
SCENARIOS_CANCEL
=
'cancel'
;
const
SCENARIOS_NO_CHARGE
=
'no_charge'
;
const
SCENARIOS_CREATE_MALL
=
'create_mall'
;
const
SCENARIOS_CREATE_MALL
=
'create_mall'
;
const
SCENARIOS_VERIFY_MALL
=
'verify_mall'
;
const
SCENARIOS_VERIFY_MALL
=
'verify_mall'
;
...
@@ -69,6 +70,7 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -69,6 +70,7 @@ class CoinIssueCoin extends CommonActiveRecord
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit'
,
'charge'
,
'token_type'
,
'nickname'
],
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit'
,
'charge'
,
'token_type'
,
'nickname'
],
self
::
SCENARIOS_CREATE_MALL
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'token_type'
,
'nickname'
],
self
::
SCENARIOS_CREATE_MALL
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'token_type'
,
'nickname'
],
self
::
SCENARIOS_VERIFY_MALL
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'token_type'
,
'nickname'
,
'template'
],
self
::
SCENARIOS_VERIFY_MALL
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'token_type'
,
'nickname'
,
'template'
],
self
::
SCENARIOS_NO_CHARGE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'token_type'
,
'nickname'
],
self
::
SCENARIOS_UPDATE
=>
[
'status'
],
self
::
SCENARIOS_UPDATE
=>
[
'status'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
];
];
...
...
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