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
745c73a4
Commit
745c73a4
authored
Oct 24, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复已知问题
parent
d611af37
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
IssueCoinController.php
api/controllers/IssueCoinController.php
+11
-1
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+10
-1
IssueCoinController.php
wallet/controllers/IssueCoinController.php
+2
-3
No files found.
api/controllers/IssueCoinController.php
View file @
745c73a4
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
api\controllers
;
namespace
api\controllers
;
use
common\models\psources\CoinIssueRecord
;
use
common\models\psources\CoinIssueRecord
;
use
common\models\psources\CoinPlatform
;
use
Yii
;
use
Yii
;
use
yii\data\Pagination
;
use
yii\data\Pagination
;
use
api\base\BaseController
;
use
api\base\BaseController
;
...
@@ -25,6 +26,14 @@ class IssueCoinController extends BaseController
...
@@ -25,6 +26,14 @@ class IssueCoinController extends BaseController
$code
=
-
1
;
$code
=
-
1
;
goto
doEnd
;
goto
doEnd
;
}
}
$coin_platform
=
CoinPlatform
::
findOne
(
$platform_id
);
if
(
false
==
$coin_platform
)
{
$msg
=
'参数错误'
;
$code
=
-
1
;
goto
doEnd
;
}
$model
=
new
CoinIssueCoin
();
$model
=
new
CoinIssueCoin
();
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
$model
->
setScenario
(
CoinIssueCoin
::
SCENARIOS_CREATE
);
...
@@ -49,7 +58,8 @@ class IssueCoinController extends BaseController
...
@@ -49,7 +58,8 @@ class IssueCoinController extends BaseController
'category'
=>
isset
(
$result
[
'category'
])
?
$result
[
'category'
]
:
0
,
'category'
=>
isset
(
$result
[
'category'
])
?
$result
[
'category'
]
:
0
,
'platform_id'
=>
$platform_id
,
'platform_id'
=>
$platform_id
,
'chain_id'
=>
$chain_id
,
'chain_id'
=>
$chain_id
,
'charge_unit_id'
=>
isset
(
$result
[
'charge_unit_id'
])
?
$result
[
'charge_unit_id'
]
:
''
'charge_unit_id'
=>
isset
(
$result
[
'charge_unit_id'
])
?
$result
[
'charge_unit_id'
]
:
''
,
'charge'
=>
$coin_platform
->
issue_charge
];
];
$model
->
load
(
$result
,
''
);
$model
->
load
(
$result
,
''
);
if
(
!
$model
->
save
())
{
if
(
!
$model
->
save
())
{
...
...
common/models/psources/CoinIssueCoin.php
View file @
745c73a4
...
@@ -42,11 +42,20 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -42,11 +42,20 @@ class CoinIssueCoin extends CommonActiveRecord
[
'msg'
,
'string'
,
'length'
=>
[
1
,
10
]],
[
'msg'
,
'string'
,
'length'
=>
[
1
,
10
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
6
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
6
]],
#['status', 'in', 'range' => [1, 2, 0]],
#['status', 'in', 'range' => [1, 2, 0]],
#['symbol', 'unique
'],
[
'symbol'
,
'verfiySymbol
'
],
[
'total'
,
'verfiyAmount'
]
[
'total'
,
'verfiyAmount'
]
];
];
}
}
public
function
verfiySymbol
(
$attribute
,
$params
)
{
$model
=
CoinIssueCoin
::
find
()
->
where
([
'symbol'
=>
$this
->
symbol
,
'platform_id'
=>
$this
->
platform_id
])
->
orderBy
(
'id desc'
)
->
one
();
if
(
0
==
$model
->
category
)
{
$this
->
addError
(
$attribute
,
'名称已存在'
);
return
false
;
}
}
public
function
verfiyAmount
(
$attribute
,
$params
)
public
function
verfiyAmount
(
$attribute
,
$params
)
{
{
$issue_record
=
CoinIssueRecord
::
find
()
->
where
([
'platform_id'
=>
$this
->
platform_id
])
->
sum
(
'total'
);
$issue_record
=
CoinIssueRecord
::
find
()
->
where
([
'platform_id'
=>
$this
->
platform_id
])
->
sum
(
'total'
);
...
...
wallet/controllers/IssueCoinController.php
View file @
745c73a4
...
@@ -28,11 +28,11 @@ class IssueCoinController extends BaseController
...
@@ -28,11 +28,11 @@ class IssueCoinController extends BaseController
$chain_id
=
\Yii
::
$app
->
request
->
get
(
'chain_id'
,
''
);
$chain_id
=
\Yii
::
$app
->
request
->
get
(
'chain_id'
,
''
);
if
(
1
==
$platform_id
)
{
if
(
1
==
$platform_id
)
{
$query
=
CoinIssueCoin
::
find
()
$query
=
CoinIssueCoin
::
find
()
->
select
(
'id, name, total, status, chain_id, charge_unit_id, platform_id, owner, category, symbol, introduction, create_time'
)
->
select
(
'id, name, total, status, chain_id, charge_unit_id,
charge,
platform_id, owner, category, symbol, introduction, create_time'
)
->
orderBy
(
'create_time desc'
);
->
orderBy
(
'create_time desc'
);
}
else
{
}
else
{
$query
=
CoinIssueCoin
::
find
()
$query
=
CoinIssueCoin
::
find
()
->
select
(
'id, name, total, status, chain_id, charge_unit_id, platform_id, owner, category, symbol, introduction, create_time'
)
->
select
(
'id, name, total, status, chain_id, charge_unit_id,
charge,
platform_id, owner, category, symbol, introduction, create_time'
)
->
where
([
'platform_id'
=>
$platform_id
])
->
where
([
'platform_id'
=>
$platform_id
])
->
orderBy
(
'create_time desc'
);
->
orderBy
(
'create_time desc'
);
}
}
...
@@ -57,7 +57,6 @@ class IssueCoinController extends BaseController
...
@@ -57,7 +57,6 @@ class IssueCoinController extends BaseController
foreach
(
$models
as
&
$val
)
{
foreach
(
$models
as
&
$val
)
{
$platform
=
isset
(
$val
->
chain
->
platform
)
?
$val
->
chain
->
platform
:
''
;
$platform
=
isset
(
$val
->
chain
->
platform
)
?
$val
->
chain
->
platform
:
''
;
$val
->
chain_name
=
$platform
;
$val
->
chain_name
=
$platform
;
$val
->
charge
=
isset
(
$val
->
platform
->
issue_charge
)
?
(
int
)
$val
->
platform
->
issue_charge
:
0
;
$val
->
charge_unit
=
isset
(
$val
->
gas
->
coin_name
)
?
$val
->
gas
->
coin_name
:
''
;
$val
->
charge_unit
=
isset
(
$val
->
gas
->
coin_name
)
?
$val
->
gas
->
coin_name
:
''
;
$val
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$val
->
url
=
Yii
::
$app
->
redis
->
hget
(
'platform_brower_info'
,
$platform
);
$val
->
total
=
(
int
)
$val
->
total
*
1e8
;
$val
->
total
=
(
int
)
$val
->
total
*
1e8
;
...
...
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