Commit b474bf2b by 孙亚楠

dd

parent 095e99d8
...@@ -137,9 +137,24 @@ class StOrderItemService extends ServiceBase { ...@@ -137,9 +137,24 @@ class StOrderItemService extends ServiceBase {
if(!(params.credit_code_array instanceof Array) && params.credit_code_array.length <0){ if(!(params.credit_code_array instanceof Array) && params.credit_code_array.length <0){
return system.getResult(null, `参数格式错误`); return system.getResult(null, `参数格式错误`);
} }
try{ try{
let list = await this.dao.invoiceTrade(params); let page = {
for (let item of list) { count: 0,
rows: []
};
params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10);
params.startRow = (params.currentPage - 1) * params.pageSize;
page.count = await this.dao.countByCondition(params);
if (page.count == 0) {
return system.getResultSuccess(page);
}
page.rows = await this.dao.invoiceTrade(params);
if(page.rows){
for (let item of page.rows) {
this.handleDate(item, ["created_at","trade_time"], null); this.handleDate(item, ["created_at","trade_time"], null);
item.amt = system.f2y(item.amt); item.amt = system.f2y(item.amt);
item.actual_amt = system.f2y(item.actual_amt); item.actual_amt = system.f2y(item.actual_amt);
...@@ -162,7 +177,9 @@ class StOrderItemService extends ServiceBase { ...@@ -162,7 +177,9 @@ class StOrderItemService extends ServiceBase {
item.trade_status_name = ""; item.trade_status_name = "";
} }
} }
return system.getResult(list); }
return system.getResult(page);
}catch (e) { }catch (e) {
console.log(e); console.log(e);
return system.getResult(null, `系统错误`); return system.getResult(null, `系统错误`);
......
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 to comment