Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
link33
plugin
Commits
a5d577e2
Commit
a5d577e2
authored
Dec 20, 2019
by
harrylee
Committed by
vipwzw
Dec 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bug
parent
d7fe5d7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
exchangedb.go
plugin/dapp/exchange/executor/exchangedb.go
+14
-6
No files found.
plugin/dapp/exchange/executor/exchangedb.go
View file @
a5d577e2
...
...
@@ -595,17 +595,20 @@ func QueryHistoryOrderList(localdb dbm.KV, left, right *et.Asset, primaryKey str
}
var
rows
[]
*
tab
.
Row
var
err
error
var
orderList
et
.
OrderList
HERE
:
if
primaryKey
==
""
{
//第一次查询,默认展示最新得成交记录
rows
,
err
=
table
.
ListIndex
(
indexName
,
prefix
,
nil
,
count
,
direction
)
}
else
{
rows
,
err
=
table
.
ListIndex
(
indexName
,
prefix
,
[]
byte
(
primaryKey
),
count
,
direction
)
}
if
err
!=
nil
{
if
err
!=
nil
&&
err
!=
types
.
ErrNotFound
{
elog
.
Error
(
"QueryCompletedOrderList."
,
"left"
,
left
,
"right"
,
right
,
"err"
,
err
.
Error
())
return
nil
,
err
}
var
orderList
et
.
OrderList
if
err
==
types
.
ErrNotFound
{
return
&
orderList
,
nil
}
for
_
,
row
:=
range
rows
{
order
:=
row
.
Data
.
(
*
et
.
Order
)
//因为这张表里面记录了 completed,revoked 两种状态的订单,所以需要过滤
...
...
@@ -615,10 +618,15 @@ func QueryHistoryOrderList(localdb dbm.KV, left, right *et.Asset, primaryKey str
//替换已经成交得量
order
.
Executed
=
order
.
GetLimitOrder
()
.
Amount
-
order
.
Balance
orderList
.
List
=
append
(
orderList
.
List
,
order
)
if
len
(
orderList
.
List
)
==
int
(
count
)
{
//设置主键索引
orderList
.
PrimaryKey
=
string
(
row
.
Primary
)
return
&
orderList
,
nil
}
}
//设置主键索引
if
len
(
rows
)
==
int
(
count
)
{
orderList
.
PrimaryKey
=
string
(
rows
[
len
(
rows
)
-
1
]
.
Primary
)
if
len
(
orderList
.
List
)
==
0
&&
len
(
rows
)
==
int
(
count
)
{
primaryKey
=
string
(
rows
[
len
(
rows
)
-
1
]
.
Primary
)
goto
HERE
}
return
&
orderList
,
nil
}
...
...
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