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
1a13a480
Commit
1a13a480
authored
Feb 18, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7afe6dbf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
WalletChainController.php
api/controllers/WalletChainController.php
+16
-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 @
1a13a480
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
api\controllers
;
namespace
api\controllers
;
use
common\models\psources\Coin
;
use
common\service\chain33\Chain33Service
;
use
common\service\chain33\Chain33Service
;
use
Yii
;
use
Yii
;
use
api\base\BaseController
;
use
api\base\BaseController
;
...
@@ -92,7 +93,7 @@ class WalletChainController extends BaseController
...
@@ -92,7 +93,7 @@ class WalletChainController extends BaseController
'port'
=>
isset
(
$post
[
'port'
])
?
$post
[
'port'
]
:
''
,
'port'
=>
isset
(
$post
[
'port'
])
?
$post
[
'port'
]
:
''
,
'wallet_address'
=>
isset
(
$post
[
'wallet_address'
])
?
$post
[
'wallet_address'
]
:
''
,
'wallet_address'
=>
isset
(
$post
[
'wallet_address'
])
?
$post
[
'wallet_address'
]
:
''
,
'status'
=>
WalletChain
::
STATUS_NO
,
'status'
=>
WalletChain
::
STATUS_NO
,
'origin'
=>
WalletChain
::
ORIGIN_
MANAGE
,
'origin'
=>
WalletChain
::
ORIGIN_
USER
,
'fee'
=>
isset
(
$post
[
'fee'
])
?
$post
[
'fee'
]
:
''
,
'fee'
=>
isset
(
$post
[
'fee'
])
?
$post
[
'fee'
]
:
''
,
'hash'
=>
isset
(
$post
[
'hash'
])
?
$post
[
'hash'
]
:
''
'hash'
=>
isset
(
$post
[
'hash'
])
?
$post
[
'hash'
]
:
''
];
];
...
@@ -119,6 +120,8 @@ class WalletChainController extends BaseController
...
@@ -119,6 +120,8 @@ class WalletChainController extends BaseController
goto
doEnd
;
goto
doEnd
;
}
}
$this
->
syncCoin
([
'platform'
=>
$params
[
'platform'
],
'token'
=>
$params
[
'token'
]]);
$chain_update
=
WalletChain
::
find
()
->
where
([
'id'
=>
$id
])
->
one
();
$chain_update
=
WalletChain
::
find
()
->
where
([
'id'
=>
$id
])
->
one
();
$chain_update
->
setScenario
(
WalletChain
::
SCENARIOS_UPDATE
);
$chain_update
->
setScenario
(
WalletChain
::
SCENARIOS_UPDATE
);
$chain_update
->
status
=
WalletChain
::
STATUS_YES
;
$chain_update
->
status
=
WalletChain
::
STATUS_YES
;
...
@@ -165,4 +168,15 @@ class WalletChainController extends BaseController
...
@@ -165,4 +168,15 @@ class WalletChainController extends BaseController
doEnd
:
doEnd
:
return
[
'code'
=>
$this
->
code
,
'data'
=>
$this
->
data
,
'msg'
=>
$this
->
msg
];
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
();
}
}
}
\ No newline at end of file
common/service/chain33/Chain33Service.php
View file @
1a13a480
...
@@ -413,7 +413,7 @@ class Chain33Service
...
@@ -413,7 +413,7 @@ class Chain33Service
'payload'
=>
[
'payload'
=>
[
'status'
=>
1
,
'status'
=>
1
,
'queryAll'
=>
true
,
'queryAll'
=>
true
,
'symbolOnly'
=>
true
//
'symbolOnly' => true
]
]
];
];
return
$this
->
send
(
$params
,
'Chain33.Query'
);
return
$this
->
send
(
$params
,
'Chain33.Query'
);
...
...
console/controllers/IssueChainTransferController.php
View file @
1a13a480
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
namespace
console\controllers
;
namespace
console\controllers
;
use
common\components\Tools
;
use
common\models\psources\CoinIssueRevokeRecord
;
use
common\models\psources\CoinIssueRevokeRecord
;
use
common\models\psources\CoinPlatformWithHold
;
use
common\models\psources\CoinPlatformWithHold
;
use
common\models\psources\WalletChain
;
use
Yii
;
use
Yii
;
use
yii\console\Controller
;
use
yii\console\Controller
;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\ArrayHelper
;
...
@@ -368,6 +370,43 @@ class IssueChainTransferController extends Controller
...
@@ -368,6 +370,43 @@ class IssueChainTransferController extends Controller
return
0
;
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
=
[])
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