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
6209a96c
Commit
6209a96c
authored
Feb 21, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into develop
parents
52925b6c
470c733c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
7 deletions
+20
-7
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
+6
-3
No files found.
api/controllers/OrderController.php
View file @
6209a96c
...
...
@@ -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 @
6209a96c
...
...
@@ -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 @
6209a96c
...
...
@@ -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 @
6209a96c
...
...
@@ -90,7 +90,7 @@ class OrderController extends Controller
//正式环境查询共识高度
//3步交易情况下需要做高度判断,2步交易无须判断
$node
_params
=
[
$node
=
[
'scheme'
=>
'https'
,
'host'
=>
'jiedian1.bityuan.com'
,
'port'
=>
8801
...
...
@@ -161,8 +161,11 @@ class OrderController extends Controller
//3步交易情况下需要做高度判断,2步交易注释IF判断
if
(
CoinCTocTransfer
::
CONSENSUE_YES
==
$val
[
'consensus'
]
&&
true
==
$switch
&&
isset
(
$height
))
{
$service
=
new
Chain33Service
(
$node_params
);
$result
=
$service
->
getHeight
();
$service
=
new
Chain33Service
(
$node
);
$result
=
$service
->
getHeight
(
$val
[
'consensus_platform'
]);
if
(
!
isset
(
$result
[
'result'
]))
{
continue
;
}
$consensHeight
=
$result
[
'result'
][
'consensHeight'
];
if
(
$consensHeight
<
$height
)
{
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