Commit bc1e33ae by 孙亚楠

d

parent d553db73
......@@ -61,6 +61,10 @@ class ActionAPI extends APIBase {
case "merchantSuggest":
opResult = await this.merchantSve.merchantSuggest(action_body);
break;
//根据商户ID查询商户信息MAP
case "merchantMapByIds":
opResult = await this.merchantSve.merchantMapByIds(action_body);
break;
//资金调账
// 新增充值
case "addMerchanttrades":
......
......@@ -166,6 +166,33 @@ class MerchantService extends ServiceBase {
}
}
/**
*fn:根据商户ID查询商户信息MAP
* @returns {Promise<void>}
*/
async merchantMapByIds(params){
try{
let listMerchant = await this.dao.model.findAll({
where:{
id:{
[this.db.Op.in]:params.ids
}
}
});
if(listMerchant.length==0){
return system.getResult({});
}
let mapMerchant ={};
for (let item of listMerchant) {
mapMerchant[item.id] = item.name;
}
return system.getResult(mapMerchant);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = MerchantService;
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