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
c54636ee
Commit
c54636ee
authored
Feb 21, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into 'master'
增加共识平台验证 See merge request
!293
parents
b6a65c66
470c733c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
OrderController.php
api/controllers/OrderController.php
+1
-0
CoinCTocTransfer.php
common/models/psources/CoinCTocTransfer.php
+11
-2
Chain33Service.php
common/service/chain33/Chain33Service.php
+2
-2
OrderController.php
console/controllers/OrderController.php
+1
-1
No files found.
api/controllers/OrderController.php
View file @
c54636ee
...
...
@@ -44,6 +44,7 @@ class OrderController extends BaseController
$data
[
'transfer_url'
]
=
$val
[
'url'
];
$data
[
'step'
]
=
$val
[
'step'
];
$data
[
'consensus'
]
=
(
false
==
$val
[
'consensus'
])
?
0
:
1
;
$data
[
'consensus_platform'
]
=
$val
[
'consensus_platform'
];
$model
->
load
(
$data
,
''
);
$model
->
save
();
}
...
...
common/models/psources/CoinCTocTransfer.php
View file @
c54636ee
...
...
@@ -38,14 +38,23 @@ class CoinCTocTransfer extends BaseActiveRecord
{
return
[
[[
'is_sell'
,
'type'
,
'address'
,
'token_name'
,
'market_name'
,
'price'
,
'amount'
,
'step'
,
'txhex'
,
'transfer_url'
,
'transfer_number'
,
'consensus'
],
'required'
],
[[
'send_result'
,
'query_result'
,
'msg'
],
'safe'
]
[[
'send_result'
,
'query_result'
,
'msg'
,
'consensus_platform'
],
'safe'
],
[
'consensus_platform'
,
'verfiyConsensusPlatform'
]
];
}
public
function
verfiyConsensusPlatform
(
$attribute
,
$params
)
{
if
(
$this
->
consensus
==
self
::
CONSENSUE_YES
&&
empty
(
$this
->
consensus_platform
)){
$this
->
addError
(
$attribute
,
'共识平台错误'
);
return
false
;
}
}
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'is_sell'
,
'type'
,
'address'
,
'token_name'
,
'market_name'
,
'price'
,
'amount'
,
'step'
,
'txhex'
,
'transfer_url'
,
'transfer_number'
,
'consensus'
],
self
::
SCENARIOS_CREATE
=>
[
'is_sell'
,
'type'
,
'address'
,
'token_name'
,
'market_name'
,
'price'
,
'amount'
,
'step'
,
'txhex'
,
'transfer_url'
,
'transfer_number'
,
'consensus'
,
'consensus_platform'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
...
...
common/service/chain33/Chain33Service.php
View file @
c54636ee
...
...
@@ -354,10 +354,10 @@ class Chain33Service
return
$this
->
send
(
$params
,
'Chain33.SendTransaction'
);
}
public
function
getHeight
(
$
params
=
[]
)
public
function
getHeight
(
$
consensus_platform
=
'game'
)
{
$params
=
[
"data"
=>
'user.p.
game
.'
,
"data"
=>
'user.p.
'
.
$consensus_platform
.
'
.'
,
];
return
$this
->
send
(
$params
,
'paracross.GetHeight'
);
}
...
...
console/controllers/OrderController.php
View file @
c54636ee
...
...
@@ -162,7 +162,7 @@ class OrderController extends Controller
//3步交易情况下需要做高度判断,2步交易注释IF判断
if
(
CoinCTocTransfer
::
CONSENSUE_YES
==
$val
[
'consensus'
]
&&
true
==
$switch
&&
isset
(
$height
))
{
$service
=
new
Chain33Service
(
$node
);
$result
=
$service
->
getHeight
();
$result
=
$service
->
getHeight
(
$val
[
'consensus_platform'
]
);
if
(
!
isset
(
$result
[
'result'
]))
{
continue
;
}
...
...
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