Commit 4c48824b by zhaoxiqing

gsb

parent 1292d3ce
......@@ -56,8 +56,11 @@ class ActionAPI extends APIBase {
case "uploadDetail": // 查询发票详细信息
opResult = await this.iinvoiceSve.uploadDetailSve(action_body);
break;
case "saasinvoicePage" : //发票列表
opResult = await this.saasinvoiceSve.saasinvoicePage(action_body);
case "merchantinvoicePage" : //发票列表(商户)
opResult = await this.saasinvoiceSve.merchantinvoicePage(action_body);
break;
case "platforminvoicePage" : //发票列表(商户)
opResult = await this.saasinvoiceSve.merchantinvoicePage(action_body);
break;
......
......@@ -32,7 +32,9 @@ class SaasinvoiceDao extends Dao {
}
setCondition(params, sql) {
sql.push("AND t1.`saas_merchant_id` = :saas_merchant_id");
if(params.saas_merchant_id){
sql.push("AND t1.`saas_merchant_id` = :saas_merchant_id");
}
if (params.apply_no) {
sql.push("AND t1.`apply_no` = :apply_no");
}
......
......@@ -12,7 +12,27 @@ class SaasinvoiceService extends ServiceBase {
}
async saasinvoicePage(params) {
async merchantinvoicePage(params) {
params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10);
params.startRow = Number((params.currentPage - 1) * params.pageSize);
let total = await this.dao.countByParams(params);
if (total == 0) {
return system.getResult({count: 0, rows: []});
}
let list = await this.dao.pageByParams(params);
if (list) {
for (var item of list) {
this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
}
}
return system.getResultSuccess({count: total, rows: list});
}
async platforminvoicePage(params) {
params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10);
params.startRow = Number((params.currentPage - 1) * params.pageSize);
......
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