Commit c2d7dc4e by 王昆

gsb

parent 66fc1a3f
......@@ -5,18 +5,26 @@ class SaasorderbusinessmenDao extends Dao {
super(Dao.getModelName(SaasorderbusinessmenDao));
}
async mapByCreditCodes(creditCodes, attrs) {
async mapByCreditCodes(params) {
let creditCodes = params.creditCodes;
let attrs = params.attrs || "*";
let result = {};
if (!creditCodes || creditCodes.length == 0) {
return result;
}
let sql = [];
sql.push("SELECT");
sql.push(attrs || "*");
sql.push(attrs);
sql.push("FROM");
sql.push(this.model.tableName);
sql.push("WHERE credit_code IN (:creditCodes)");
let list = await this.customQuery(sql.join(" "), {creditCodes: creditCodes}) || [];
if (params.saas_merchant_id) {
sql.push("AND merchant_id = :saas_merchant_id");
}
if (params.merchant_id) {
sql.push("AND merchant_id = :merchant_id");
}
let list = await this.customQuery(sql.join(" "), params) || [];
if (list.length == 0) {
return result;
}
......
......@@ -557,7 +557,7 @@ class SaasOrderService extends ServiceBase {
}
async mapByCreditCodes(params) {
let rs = await this.saasorderbusinessmenDao.mapByCreditCodes(params.creditCodes, params.attrs) || {};
let rs = await this.saasorderbusinessmenDao.mapByCreditCodes(params) || {};
return system.getResultSuccess(rs);
}
......
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