Commit 1cb502c3 by zhaoxiqing

gsb

parent 82001e25
...@@ -9,13 +9,18 @@ class merchantCtl extends CtlBase { ...@@ -9,13 +9,18 @@ class merchantCtl extends CtlBase {
constructor() { constructor() {
super(); super();
this.merchantSve = system.getObject("service.merchant.merchantSve"); this.merchantSve = system.getObject("service.merchant.merchantSve");
this.userSve = system.getObject("service.uc.userSve");
} }
async merchantOfInfo(params, pobj2, req) { async merchantOfInfo(params, pobj2, req) {
try { try {
params.merchant_id = req.body.merchant_id; params.id = req.body.merchant_id;
return await this.merchantSve.merchantOfInfo(params); let res = await this.merchantSve.merchantOfInfo(params);
if (res.data) {
await this.userSve.setRowsUser([res.data], "bd_id", "bd");
}
return res;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
......
...@@ -53,6 +53,28 @@ class UserService extends ServiceBase { ...@@ -53,6 +53,28 @@ class UserService extends ServiceBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
async setRowsUser(rows, field, objectField) {
objectField = objectField || "user";
if (!rows || rows.length == 0 || !field) {
return;
}
let ids = [];
for (let item of rows) {
let id = Number(item[field] || 0);
if(!id) {
continue;
}
ids.push(id);
}
let map = await this.mapByIds({ids: ids});
for (let item of rows) {
item[objectField] = map[item[field]] || {};
}
}
} }
module.exports = UserService; module.exports = UserService;
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