Commit afe1214a by 孙亚楠

d

parent 65742cde
......@@ -197,9 +197,9 @@ class ActionAPI extends APIBase {
case "saasorderbusinessmenPage": // 订单信息
opResult = await this.saasorderbusinessmenSve.saasorderbusinessmenPage(action_body);
break;
// case "queryBusinessmenByMerchantId": //根据商户ID,SAAS_ID查询所有的个体户
// opResult = await this.saasorderbusinessmenSve.queryBusinessmenByMerchantId(action_body);
// break;
case "businessmenByOrderIds": // 根据订单IDS查询个体户记录
opResult = await this.saasorderbusinessmenSve.businessmenByOrderIds(action_body);
break;
case "assorderBusinessmenInfo": // 订单信息
opResult = await this.saasorderbusinessmenSve.assorderBusinessmenInfo(action_body);
break;
......
......@@ -59,6 +59,10 @@ class SaasOrderDao extends Dao {
sql.push("AND t1.merchant_id = :merchant_id");
}
if (params.channel_id) {
sql.push("AND t1.channel_id = :channel_id");
}
if (params.pay_status) {
sql.push("AND t1.pay_status = :pay_status");
}
......
......@@ -99,6 +99,24 @@ class SaasorderbusinessmenDao extends Dao {
return await this.customQuery(sql.join(" "), params);
}
/**
* 根据order_id 查个体户信息
* @param ids
* @returns {Promise<void>}
*/
async getByOrderIds(ids){
if(!ids || ids.length == 0){
return {};
}
let sql = `select * from saas_order_businessmen where 1=1 and id in (:ids)`;
let list = await this.customQuery(sql, {ids:ids});
let map = {};
for(let item of list) {
map[item.id] = item;
}
return map;
}
}
module.exports = SaasorderbusinessmenDao;
......@@ -331,7 +331,7 @@ class SaasOrderService extends ServiceBase {
page.rows = await this.dao.listByCondition(params);
if (page.rows) {
for (var row of page.rows) {
this.handleDate(row, ["created_at"], null );
this.handleDate(row, ["created_at",], null );
}
await this.setBminfo(page.rows);
......
......@@ -91,6 +91,27 @@ class SaasorderbusinessmenService extends ServiceBase {
return system.getResult(null, `系统错误`);
}
}
/**
* fn:根据订单IDS查询个体户(多个查询)
* @param params
* @returns {Promise<void>}
*/
async businessmenByOrderIds(params){
if(!params.order_ids || params.order_ids.length<=0){
return system.getResult({});
}
try{
let res = await this.dao.getByOrderIds(params.order_ids);
for (let key in res) {
this.handleDate(res[key], ["created_at", "reg_date", "service_begin_time", "service_end_time", "sign_time", "tax_reg_day"], "YYYY-MM-DD HH:mm:ss");
}
return system.getResult(res);
}catch (e) {
console.log(e);
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