Files
jjx-web/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getCompany.js
T
b2894lxlx aa1df73a53 1、新增签约宝
2、调整自营
3、新增购物车(未完善)
2023-12-04 19:25:58 +08:00

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 (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;
}
}