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
1b095a0f
Commit
1b095a0f
authored
Feb 11, 2020
by
shajiaming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into develop
parents
99c5b3db
f616f51e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
MarketController.php
api/controllers/MarketController.php
+1
-1
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+2
-2
OrderController.php
console/controllers/OrderController.php
+7
-5
No files found.
api/controllers/MarketController.php
View file @
1b095a0f
...
...
@@ -36,7 +36,7 @@ class MarketController extends BaseController
public
function
actionExchange
()
{
$exchanges
=
Yii
::
$app
->
params
[
'exchange'
]
;
$exchanges
=
array_unique
(
Yii
::
$app
->
params
[
'exchange'
])
;
return
[
'code'
=>
$this
->
code
,
'msg'
=>
$this
->
msg
,
'data'
=>
$exchanges
];
}
...
...
common/business/ExchangeBusiness.php
View file @
1b095a0f
...
...
@@ -187,7 +187,7 @@ class ExchangeBusiness
if
(
in_array
(
strtoupper
(
$tag
),
[
'SFT'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Zhaobi"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'
CNY
'
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'
USDT
'
);
$quotation
[
'low'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'low'
]);
$quotation
[
'high'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'high'
]);
$quotation
[
'last'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
...
...
@@ -329,7 +329,7 @@ class ExchangeBusiness
$exchange
=
ExchangeFactory
::
createExchange
(
"Go"
);
$rate
=
$exchange
->
getTicker
(
"CNY"
,
"USD"
);
$cny_usd_rate
=
1
/
$rate
[
'last'
];
if
(
in_array
(
strtoupper
(
$tag
),
[
'FOLI'
,
'CIC'
,
'KPC8'
,
'BVA'
,
'DAG'
,
'BNC'
,
'GHP'
,
'DRA'
,
'ETC'
,
'PAX'
,
'STH'
,
'XJH'
]))
{
if
(
in_array
(
strtoupper
(
$tag
),
[
'FOLI'
,
'CIC'
,
'KPC8'
,
'BVA'
,
'DAG'
,
'BNC'
,
'GHP'
,
'DRA'
,
'ETC'
,
'PAX'
,
'STH'
,
'XJH'
,
'SFT'
]))
{
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
}
else
if
(
in_array
(
strtoupper
(
$tag
),
[
'SUSD'
]))
{
...
...
console/controllers/OrderController.php
View file @
1b095a0f
...
...
@@ -103,9 +103,6 @@ class OrderController extends Controller
// 'host' => '172.16.100.77',
// 'port' => 8801
// ];
$service
=
new
Chain33Service
(
$node_params
);
$result
=
$service
->
getHeight
();
$consensHeight
=
$result
[
'result'
][
'consensHeight'
];
$current_time
=
time
();
foreach
(
$model
as
$val
)
{
...
...
@@ -163,8 +160,13 @@ class OrderController extends Controller
doEnd
:
//3步交易情况下需要做高度判断,2步交易注释IF判断
if
(
CoinCTocTransfer
::
CONSENSUE_YES
==
$val
[
'consensus'
]
&&
true
==
$switch
&&
isset
(
$height
)
&&
(
$consensHeight
<
$height
))
{
continue
;
if
(
CoinCTocTransfer
::
CONSENSUE_YES
==
$val
[
'consensus'
]
&&
true
==
$switch
&&
isset
(
$height
))
{
$service
=
new
Chain33Service
(
$node_params
);
$result
=
$service
->
getHeight
();
$consensHeight
=
$result
[
'result'
][
'consensHeight'
];
if
(
$consensHeight
<
$height
)
{
continue
;
}
}
$currentModel
=
CoinCTocTransfer
::
findOne
(
$val
[
'id'
]);
$currentModel
->
query_result
=
$query_result
;
...
...
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