Commit 4de96ecc by 孙亚楠

d

parent 417f5379
...@@ -59,11 +59,25 @@ class MerchantUserCtl extends CtlBase { ...@@ -59,11 +59,25 @@ class MerchantUserCtl extends CtlBase {
params.utype = 2; params.utype = 2;
params.uctype_id = this.trim(params.merchant_id); params.uctype_id = this.trim(params.merchant_id);
let res = await this.userSve.page(params); let res = await this.userSve.page(params);
let merchant_ids = new Set();
if (res.status === 0 && res.data && res.data.rows) { if (res.status === 0 && res.data && res.data.rows) {
for (let item of res.data.rows) { for (let item of res.data.rows) {
item.merchant = {id:"todo", name: "todo"}; // item.merchant = {id:"todo", name: "todo"};
merchant_ids.add(item.uctype_id);
} }
} }
if(merchant_ids.size==0){
return res;
}
let merchantDist = await this.merchantSve.merchantMapByIds({ids:Array.from(merchant_ids)});
if(merchantDist.status!=0 || !merchantDist.data){
return res;
}
merchantDist = merchantDist.data;
for (let item of res.data.rows) {
item.merchant_name = merchantDist[item.uctype_id] || "";
}
return res; return res;
} catch (error) { } catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
......
...@@ -45,6 +45,14 @@ class MerchantService extends ServiceBase { ...@@ -45,6 +45,14 @@ class MerchantService extends ServiceBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
/**
* fn:根据商户ID查询商户信息MAP
* @returns {Promise<void>}
*/
async merchantMapByIds(params){
return await this.callms("sve_merchant", "merchantMapByIds", params);
}
} }
module.exports = MerchantService; 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