Commit 9ee32e50 by 杨铁龙

更改getOrders

parent d6a7d544
Showing with 8 additions and 4 deletions
...@@ -63,12 +63,16 @@ class OrderService { ...@@ -63,12 +63,16 @@ class OrderService {
.execute(); .execute();
} }
public getOrders(productId: number, index: number, size = 100) { public getOrders(params: {
return this.getSdk() productId?: number; index: number; size?: number
}) {
const list = this.getSdk()
.model(this.generalOrder) .model(this.generalOrder)
.list("userOrderList") .list("userOrderList")
.addPrefilter({ ProductId: productId }) if (params.productId) {
.query({ item_size: size, pageIndex: index }) list.addPrefilter({ ProductId: params.productId })
}
return list.query({ item_size: params.size || 100, pageIndex: params.index })
.then((r) => { .then((r) => {
return { return {
total: r.pageData.record_count, total: r.pageData.record_count,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment