Commit edbce195 by 王昆

gsb

parent 4d24b5a1
......@@ -7,6 +7,7 @@ const settings = require("../../../../config/settings");
class LabourService extends ServiceBase {
constructor() {
super("operator", ServiceBase.getDaoName(LabourService));
this.usersDao = system.getObject("db.operator.usersDao");
}
async SaveLabourInfo(params){//添加或更新招聘信息
......@@ -108,6 +109,9 @@ class LabourService extends ServiceBase {
raw: true
};
var list = await this.dao.model.findAndCountAll(sqlwhere) || [];
if(list) {
await this.setUserInfo(list.rows);
}
return system.getResult(list);
}catch (e) {
console.log(e);
......@@ -165,6 +169,19 @@ class LabourService extends ServiceBase {
}
}
async setUserInfo(rows) {
if (!rows || rows.length == 0) {
return;
}
var ids = [];
for (var row of rows) {
ids.push(row.user_id);
}
var map = await this.usersDao.findUserInfoByids(ids);
for (var row of rows) {
row.userInfo = map[row.user_id] || {};
}
}
}
module.exports = LabourService;
......
......@@ -7,6 +7,7 @@ const settings = require("../../../../config/settings");
class RecruitService extends ServiceBase {
constructor() {
super("operator", ServiceBase.getDaoName(RecruitService));
this.usersDao = system.getObject("db.operator.usersDao");
}
async SaveRecruitInfo(params){//添加或更新招聘信息
......@@ -236,6 +237,9 @@ class RecruitService extends ServiceBase {
raw: true
};
var list = await this.dao.model.findAndCountAll(sqlwhere) || [];
if(list) {
await this.setUserInfo(list.rows);
}
return system.getResult(list);
}catch (e) {
console.log(e);
......@@ -244,6 +248,20 @@ class RecruitService extends ServiceBase {
}
async setUserInfo(rows) {
if (!rows || rows.length == 0) {
return;
}
var ids = [];
for (var row of rows) {
ids.push(row.user_id);
}
var map = await this.usersDao.findUserInfoByids(ids);
for (var row of rows) {
row.userInfo = map[row.user_id] || {};
}
}
async updatestatus(obj){//更新状态信息
try{
var whereobj = {where:{id: obj.id}};
......
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