36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
'use strict';
|
|
const dbName = require("../../../../dao/config");
|
|
module.exports = {
|
|
/**
|
|
* 企业用户列表
|
|
* @url client/user/pub/getCompany 前端调用的url参数地址
|
|
* data 请求参数
|
|
* @param {String} params1 参数1
|
|
*/
|
|
main: async (event) => {
|
|
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
|
|
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
|
|
let {uid} = data;
|
|
let res = {code: 0, msg: ""};
|
|
const whereJson = {
|
|
accountType: 2
|
|
}
|
|
if (!vk.pubfn.isNull(data.keyword)) whereJson['company.companyName'] = new RegExp(data.keyword);
|
|
if (!vk.pubfn.isNull(data.isCoop)) whereJson.isCoop = data.isCoop;
|
|
if (vk.pubfn.isNull(data.isCoop) && data.province.length > 0) {
|
|
whereJson['businessCard.address.province.code'] = _.in(data.province);
|
|
}
|
|
if (data.mainSpotCategoryIds.length > 0) {
|
|
whereJson['businessCard.mainSpotCategoryIds'] = _.in(data.mainSpotCategoryIds);
|
|
}
|
|
// 业务逻辑开始-----------------------------------------------------------
|
|
res = await vk.baseDao.getTableData({
|
|
dbName: dbName.user,
|
|
whereJson
|
|
});
|
|
console.log('whereJson', whereJson)
|
|
// 业务逻辑结束-----------------------------------------------------------
|
|
return res;
|
|
}
|
|
}
|