Files
jjx-web-sign-only/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getCompany.js
T
2023-12-05 22:37:53 +08:00

37 lines
1.5 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.province) && data.province && data.province.length > 0) {
whereJson['businessCard.address.province.code'] = _.in(data.province);
}
if (vk.pubfn.isNull(data.mainSpotCategoryIds) && data.mainSpotCategoryIds && data.mainSpotCategoryIds.length > 0) {
whereJson['businessCard.mainSpotCategoryIds'] = _.in(data.mainSpotCategoryIds);
}
// 业务逻辑开始-----------------------------------------------------------
res = await vk.baseDao.select({
dbName: dbName.user,
whereJson,
pageSize: -1
});
console.log('whereJson', whereJson)
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}