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
2b52d11e
Commit
2b52d11e
authored
Feb 18, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Plain Diff
solve conflict
parents
4ac48a38
1a13a480
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
2 deletions
+55
-2
WalletChainController.php
api/controllers/WalletChainController.php
+15
-1
Chain33Service.php
common/service/chain33/Chain33Service.php
+1
-1
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+39
-0
No files found.
api/controllers/WalletChainController.php
View file @
2b52d11e
...
...
@@ -2,6 +2,7 @@
namespace
api\controllers
;
use
common\models\psources\Coin
;
use
common\service\chain33\Chain33Service
;
use
Yii
;
use
api\base\BaseController
;
...
...
@@ -92,7 +93,7 @@ class WalletChainController extends BaseController
'port'
=>
isset
(
$post
[
'port'
])
?
$post
[
'port'
]
:
''
,
'wallet_address'
=>
isset
(
$post
[
'wallet_address'
])
?
$post
[
'wallet_address'
]
:
''
,
'status'
=>
WalletChain
::
STATUS_NO
,
'origin'
=>
WalletChain
::
ORIGIN_
MANAGE
,
'origin'
=>
WalletChain
::
ORIGIN_
USER
,
'fee'
=>
isset
(
$post
[
'fee'
])
?
$post
[
'fee'
]
:
''
,
'hash'
=>
isset
(
$post
[
'hash'
])
?
$post
[
'hash'
]
:
''
];
...
...
@@ -119,6 +120,8 @@ class WalletChainController extends BaseController
goto
doEnd
;
}
$this
->
syncCoin
([
'platform'
=>
$params
[
'platform'
],
'token'
=>
$params
[
'token'
]]);
$chain_update
=
WalletChain
::
find
()
->
where
([
'id'
=>
$id
])
->
one
();
$chain_update
->
setScenario
(
WalletChain
::
SCENARIOS_UPDATE
);
$chain_update
->
status
=
WalletChain
::
STATUS_YES
;
...
...
@@ -165,4 +168,15 @@ class WalletChainController extends BaseController
doEnd
:
return
[
'code'
=>
$this
->
code
,
'data'
=>
$this
->
data
,
'msg'
=>
$this
->
msg
];
}
public
function
syncCoin
(
$params
=
[])
{
$model
=
new
Coin
();
$model
->
nickname
=
[
'ja'
=>
''
,
'en-US'
=>
''
,
'zh-CN'
=>
''
];
$model
->
name
=
$params
[
'token'
];
$model
->
platform
=
$params
[
'platform'
];
$model
->
chain
=
'BTY'
;
$model
->
platform_id
=
1
;
$model
->
save
();
}
}
common/service/chain33/Chain33Service.php
View file @
2b52d11e
...
...
@@ -413,7 +413,7 @@ class Chain33Service
'payload'
=>
[
'status'
=>
1
,
'queryAll'
=>
true
,
'symbolOnly'
=>
true
//
'symbolOnly' => true
]
];
return
$this
->
send
(
$params
,
'Chain33.Query'
);
...
...
console/controllers/IssueChainTransferController.php
View file @
2b52d11e
...
...
@@ -2,8 +2,10 @@
namespace
console\controllers
;
use
common\components\Tools
;
use
common\models\psources\CoinIssueRevokeRecord
;
use
common\models\psources\CoinPlatformWithHold
;
use
common\models\psources\WalletChain
;
use
Yii
;
use
yii\console\Controller
;
use
yii\helpers\ArrayHelper
;
...
...
@@ -368,6 +370,43 @@ class IssueChainTransferController extends Controller
return
0
;
}
public
function
actionAsynCoin
()
{
$chains
=
WalletChain
::
find
()
->
select
(
'host, platform'
)
->
where
([
'status'
=>
1
,
'origin'
=>
WalletChain
::
ORIGIN_USER
])
->
asArray
()
->
all
();
foreach
(
$chains
as
$chain
){
$node
=
[
'scheme'
=>
'http'
,
'host'
=>
$chain
[
'host'
],
'port'
=>
8901
];
$chain_service
=
new
Chain33Service
(
$node
);
$result
=
$chain_service
->
getTokens
(
'token'
,
'GetTokens'
);
if
(
null
!=
$result
[
'error'
])
continue
;
$tokens
=
isset
(
$result
[
'result'
][
'tokens'
])
?
$result
[
'result'
][
'tokens'
]
:
null
;
if
(
null
==
$tokens
)
continue
;
foreach
(
$tokens
as
$key
=>
$token
)
{
$model_coin
=
Coin
::
find
()
->
where
([
'name'
=>
$token
[
'symbol'
],
'platform'
=>
$chain
[
'platform'
],
'chain'
=>
'BTY'
])
->
one
();
if
(
empty
(
$model_coin
))
{
$model
=
new
Coin
();
$model
->
name
=
$token
[
'symbol'
];
$model
->
sid
=
$token
[
'name'
];
$model
->
nickname
=
[
'ja'
=>
''
,
'en-US'
=>
''
,
'zh-CN'
=>
''
];
$model
->
introduce
=
[
'ja'
=>
''
,
'en-US'
=>
''
,
'zh-CN'
=>
$token
[
'introduction'
]];
$model
->
platform
=
$chain
[
'platform'
];
$model
->
publish_count
=
$token
[
'total'
];
$model
->
chain
=
'BTY'
;
$model
->
platform_id
=
1
;
$model
->
treaty
=
1
;
$model
->
save
();
}
}
}
}
public
function
syncCoin
(
$params
=
[])
{
...
...
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