20261008
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
/**
|
||||
* XXXnameXXX
|
||||
* @url admin/article/category/sys/update 前端调用的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 adKey = parseInt(data.adKey)
|
||||
const categoryFilterAdKeys = [9, 10, 11, 12, 13, 14, 112, 122]
|
||||
|
||||
if ([36, 37, 38].includes(adKey) && !data.spotGoodsId) {
|
||||
return {code: -1, msg: '请选择现货'}
|
||||
}
|
||||
if (categoryFilterAdKeys.includes(adKey) && data.filterMode === 'category' && !(Array.isArray(data.categoryIds) ? data.categoryIds.length : (data.categoryId || data.categoryName))) {
|
||||
return {code: -1, msg: '请选择分类'}
|
||||
}
|
||||
if (categoryFilterAdKeys.includes(adKey) && data.filterMode === 'category' && !(data.region && data.region.province && data.region.province.code)) {
|
||||
return {code: -1, msg: '请选择区域'}
|
||||
}
|
||||
if (![36, 37, 38].includes(adKey) && data.filterMode !== 'category' && data.type === 'company' && !data.companyId) {
|
||||
return {code: -1, msg: '请选择指定公司'}
|
||||
}
|
||||
if (![36, 37, 38].includes(adKey) && data.filterMode !== 'category' && data.type === 'goods' && !data.goodsId) {
|
||||
return {code: -1, msg: '请选择指定商品'}
|
||||
}
|
||||
|
||||
await vk.baseDao.updateById({
|
||||
dbName: 'jjx-ad',
|
||||
dataJson: data,
|
||||
id: data._id
|
||||
});
|
||||
|
||||
|
||||
// 业务逻辑结束-----------------------------------------------------------
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user