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
b926fce7
Commit
b926fce7
authored
Jan 13, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
fbe388b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
15 deletions
+35
-15
IssueCoinController.php
api/controllers/IssueCoinController.php
+35
-15
No files found.
api/controllers/IssueCoinController.php
View file @
b926fce7
...
...
@@ -59,15 +59,15 @@ class IssueCoinController extends BaseController
'nickname'
=>
isset
(
$result
[
'nickname'
])
?
$result
[
'nickname'
]
:
''
];
$model
=
new
CoinIssueCoin
();
if
(
0
==
$params
[
'token_type'
]){
if
(
0
==
$params
[
'token_type'
])
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
}
if
(
in_array
(
$params
[
'token_type'
],
[
1
,
2
])){
if
(
in_array
(
$params
[
'token_type'
],
[
1
,
2
]))
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_NO_CHARGE
);
}
if
(
in_array
(
$params
[
'token_type'
],
[
3
,
4
])){
if
(
in_array
(
$params
[
'token_type'
],
[
3
,
4
]))
{
$params
[
'template'
]
=
isset
(
$result
[
'template'
])
?
$result
[
'template'
]
:
[];
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_VERIFY_MALL
);
}
...
...
@@ -147,15 +147,15 @@ class IssueCoinController extends BaseController
];
$model
=
new
CoinIssueCoin
();
if
(
0
==
$params
[
'token_type'
]){
if
(
0
==
$params
[
'token_type'
])
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
}
if
(
in_array
(
$params
[
'token_type'
],
[
1
,
2
])){
if
(
in_array
(
$params
[
'token_type'
],
[
1
,
2
]))
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_NO_CHARGE
);
}
if
(
in_array
(
$params
[
'token_type'
],
[
3
,
4
])){
if
(
in_array
(
$params
[
'token_type'
],
[
3
,
4
]))
{
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE_MALL
);
}
...
...
@@ -507,26 +507,46 @@ class IssueCoinController extends BaseController
$code
=
0
;
$msg
=
'success'
;
$symbol
=
Yii
::
$app
->
request
->
post
(
'symbol'
,
''
);
if
(
false
==
$symbol
)
{
$token_type
=
Yii
::
$app
->
request
->
post
(
'token_type'
,
''
);
if
(
false
==
$symbol
||
false
==
$token_type
)
{
$msg
=
'缺少必要的参数'
;
$code
=
-
1
;
$data
=
null
;
goto
doEnd
;
}
$model
=
CoinIssueCoin
::
find
()
->
where
([
'symbol'
=>
$symbol
,
'platform_id'
=>
35
])
->
asArray
()
->
one
();
$model
=
CoinIssueCoin
::
find
()
->
where
([
'like'
,
'symbol'
,
$symbol
.
'%'
,
false
])
->
andWhere
([
'platform_id'
=>
35
])
->
andWhere
([
'token_type'
=>
(
int
)
$token_type
])
->
orderBy
(
'id desc'
)
->
asArray
()
->
one
();
if
(
empty
(
$model
))
{
$data
=
$symbol
;
goto
doEnd
;
}
$data
=
$model
[
'symbol'
];
$suffix
=
substr
(
$data
,
-
1
);
if
(
is_numeric
(
$suffix
))
{
$prefix
=
substr
(
$data
,
0
,
-
1
);
$data
=
$prefix
.
(
$suffix
+
1
);
}
else
{
$data
=
$data
.
1
;
if
(
$symbol
==
$model
[
'symbol'
])
{
$data
=
$model
[
'symbol'
]
.
'01'
;
goto
doEnd
;
}
$prefix
=
(
explode
(
$symbol
,
$model
[
'symbol'
]))[
1
];
$prefix
++
;
if
(
$prefix
<
10
)
{
$data
=
$symbol
.
'0'
.
$prefix
;
goto
doEnd
;
}
$data
=
$symbol
.
$prefix
;
// $suffix = substr($data, -1);
// if (is_numeric($suffix)) {
// $prefix = substr($data, 0, -1);
// $data = $prefix . ($suffix + 1);
// } else {
// $data = $data . 1;
// }
doEnd
:
return
[
'code'
=>
$code
,
'msg'
=>
$msg
,
'data'
=>
$data
];
...
...
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