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
f9c8f151
Commit
f9c8f151
authored
Jan 17, 2019
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
impl list local order
parent
ea732b09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
local_order.go
plugin/dapp/trade/executor/local_order.go
+24
-1
No files found.
plugin/dapp/trade/executor/local_order.go
View file @
f9c8f151
...
@@ -130,7 +130,6 @@ func (r *OrderRow) isSell() int {
...
@@ -130,7 +130,6 @@ func (r *OrderRow) isSell() int {
// 进行中, 撤销, 部分成交 , 全部成交, 完成状态统一前缀. 数字和原来不一样
// 进行中, 撤销, 部分成交 , 全部成交, 完成状态统一前缀. 数字和原来不一样
// 01 10 11 12 19 -> 1*
// 01 10 11 12 19 -> 1*
func
(
r
*
OrderRow
)
status
()
string
{
func
(
r
*
OrderRow
)
status
()
string
{
// if r.Status == 1 || r.Status == 10 || r.Status == 11 || r.Status == 12 {}
if
r
.
Status
==
pty
.
TradeOrderStatusOnBuy
||
r
.
Status
==
pty
.
TradeOrderStatusOnSale
{
if
r
.
Status
==
pty
.
TradeOrderStatusOnBuy
||
r
.
Status
==
pty
.
TradeOrderStatusOnSale
{
return
"01"
// 试图用1 可以匹配所有完成的
return
"01"
// 试图用1 可以匹配所有完成的
}
else
if
r
.
Status
==
pty
.
TradeOrderStatusSoldOut
||
r
.
Status
==
pty
.
TradeOrderStatusBoughtOut
{
}
else
if
r
.
Status
==
pty
.
TradeOrderStatusSoldOut
||
r
.
Status
==
pty
.
TradeOrderStatusBoughtOut
{
...
@@ -370,6 +369,30 @@ func (t *trade) genBuyMarket(tx *types.Transaction, buy *pty.ReceiptBuyBase, txI
...
@@ -370,6 +369,30 @@ func (t *trade) genBuyMarket(tx *types.Transaction, buy *pty.ReceiptBuyBase, txI
return
order
return
order
}
}
func
list
(
db
db
.
KVDB
,
indexName
string
,
data
*
pty
.
LocalOrder
,
count
,
direction
int32
)
([]
*
table
.
Row
,
error
)
{
query
:=
NewOrderTable
(
db
)
var
primary
[]
byte
if
len
(
data
.
TxIndex
)
>
0
{
primary
=
[]
byte
(
data
.
TxIndex
)
}
cur
:=
&
OrderRow
{
LocalOrder
:
data
}
index
,
err
:=
cur
.
Get
(
indexName
)
if
err
!=
nil
{
tradelog
.
Error
(
"query List failed"
,
"key"
,
string
(
primary
),
"param"
,
data
)
return
nil
,
err
}
rows
,
err
:=
query
.
ListIndex
(
indexName
,
index
,
primary
,
count
,
direction
)
if
err
!=
nil
{
tradelog
.
Error
(
"query List failed"
,
"key"
,
string
(
primary
),
"param"
,
data
)
return
nil
,
err
}
if
len
(
rows
)
==
0
{
return
nil
,
types
.
ErrNotFound
}
return
rows
,
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