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
d05ed7aa
Commit
d05ed7aa
authored
Feb 20, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d3bd85bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
WalletChainController.php
api/controllers/WalletChainController.php
+1
-1
CoinPlatformWithHold.php
common/models/psources/CoinPlatformWithHold.php
+4
-2
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+23
-1
No files found.
api/controllers/WalletChainController.php
View file @
d05ed7aa
...
@@ -139,7 +139,7 @@ class WalletChainController extends BaseController
...
@@ -139,7 +139,7 @@ class WalletChainController extends BaseController
$params
=
[
$params
=
[
'id'
=>
$id
,
'id'
=>
$id
,
'hash'
=>
$hash
,
'hash'
=>
$hash
,
'status'
=>
CoinPlatformWithHold
::
STATUS_
YES
'status'
=>
CoinPlatformWithHold
::
STATUS_
CREATEING
];
];
if
(
$model
->
load
(
$params
,
''
)
&&
!
$model
->
save
())
{
if
(
$model
->
load
(
$params
,
''
)
&&
!
$model
->
save
())
{
$errors
=
''
;
$errors
=
''
;
...
...
common/models/psources/CoinPlatformWithHold.php
View file @
d05ed7aa
...
@@ -13,6 +13,7 @@ class CoinPlatformWithHold extends BaseActiveRecord
...
@@ -13,6 +13,7 @@ class CoinPlatformWithHold extends BaseActiveRecord
//定义场景
//定义场景
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_UPDATE
=
'update'
;
const
SCENARIOS_UPDATE
=
'update'
;
const
SCENARIOS_CONSOLE
=
'console'
;
const
STATUS_NO
=
0
;
//创建失败
const
STATUS_NO
=
0
;
//创建失败
const
STATUS_YES
=
1
;
//创建成功
const
STATUS_YES
=
1
;
//创建成功
...
@@ -45,8 +46,8 @@ class CoinPlatformWithHold extends BaseActiveRecord
...
@@ -45,8 +46,8 @@ class CoinPlatformWithHold extends BaseActiveRecord
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'platform'
,
'address'
,
'private_key'
,
'exe
cer'
,
'exe
r'
,
'brower_url'
,
'token'
,
'host'
,
'wallet_address'
,
'status'
,
'port'
,
'fee'
,
'origin'
],
'required'
],
[[
'platform'
,
'address'
,
'private_key'
,
'exer'
,
'brower_url'
,
'token'
,
'host'
,
'wallet_address'
,
'status'
,
'port'
,
'fee'
,
'origin'
],
'required'
],
[[
'platform'
,
'address'
,
'private_key'
,
'exe
cer'
,
'exe
r'
,
'brower_url'
,
'token'
,
'host'
,
'wallet_address'
,
'hash'
],
'string'
],
[[
'platform'
,
'address'
,
'private_key'
,
'exer'
,
'brower_url'
,
'token'
,
'host'
,
'wallet_address'
,
'hash'
],
'string'
],
[
'address'
,
'unique'
,
'message'
=>
'地址已存在'
],
[
'address'
,
'unique'
,
'message'
=>
'地址已存在'
],
[[
'platform'
],
'string'
,
'length'
=>
[
1
,
30
]],
[[
'platform'
],
'string'
,
'length'
=>
[
1
,
30
]],
[[
'token'
],
'string'
,
'length'
=>
[
1
,
10
]],
[[
'token'
],
'string'
,
'length'
=>
[
1
,
10
]],
...
@@ -60,6 +61,7 @@ class CoinPlatformWithHold extends BaseActiveRecord
...
@@ -60,6 +61,7 @@ class CoinPlatformWithHold extends BaseActiveRecord
$scenarios
=
[
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'platform'
,
'token'
,
'address'
,
'private_key'
,
'fee'
,
'host'
,
'port'
,
'wallet_address'
,
'status'
,
'origin'
,
'hash'
,
'exer'
],
self
::
SCENARIOS_CREATE
=>
[
'platform'
,
'token'
,
'address'
,
'private_key'
,
'fee'
,
'host'
,
'port'
,
'wallet_address'
,
'status'
,
'origin'
,
'hash'
,
'exer'
],
self
::
SCENARIOS_UPDATE
=>
[
'id'
,
'hash'
,
'status'
],
self
::
SCENARIOS_UPDATE
=>
[
'id'
,
'hash'
,
'status'
],
self
::
SCENARIOS_CONSOLE
=>
[
'status'
],
];
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
}
...
...
console/controllers/IssueChainTransferController.php
View file @
d05ed7aa
...
@@ -370,10 +370,32 @@ class IssueChainTransferController extends Controller
...
@@ -370,10 +370,32 @@ class IssueChainTransferController extends Controller
return
0
;
return
0
;
}
}
public
function
actionUpdateChain
()
{
$current_time
=
date
(
'Y-m-d H:i:s'
);
$chains
=
CoinPlatformWithHold
::
find
()
->
where
([
'status'
=>
CoinPlatformWithHold
::
STATUS_CREATEING
,
'origin'
=>
CoinPlatformWithHold
::
ORIGIN_USER
])
->
andWhere
([
'<'
,
'create_time'
,
$current_time
])
->
all
();
if
(
empty
(
$chains
))
{
echo
date
(
'Y-m-d H:i:s'
)
.
'无需更新的链'
.
PHP_EOL
;
return
0
;
}
foreach
(
$chains
as
$chain
)
{
$chain
->
setScenario
(
CoinPlatformWithHold
::
SCENARIOS_CONSOLE
);
$chain
->
status
=
CoinPlatformWithHold
::
STATUS_YES
;
$chain
->
save
();
}
echo
date
(
'Y-m-d H:i:s'
)
.
'更新成功'
.
PHP_EOL
;
return
0
;
}
public
function
actionAsyncCoin
()
public
function
actionAsyncCoin
()
{
{
$chains
=
CoinPlatformWithHold
::
find
()
->
select
(
'host, platform'
)
$chains
=
CoinPlatformWithHold
::
find
()
->
select
(
'host, platform'
)
->
where
([
'status'
=>
1
,
'origin'
=>
WalletChain
::
ORIGIN_USER
])
->
where
([
'status'
=>
1
,
'origin'
=>
CoinPlatformWithHold
::
ORIGIN_USER
])
->
asArray
()
->
asArray
()
->
all
();
->
all
();
foreach
(
$chains
as
$chain
){
foreach
(
$chains
as
$chain
){
...
...
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