Commit 919fd2e8 by wkliang

fix

parent 3422f478
......@@ -37,28 +37,18 @@ class ActionAPI extends APIBase {
action_body.types, action_body.keywords)
break
case 'createOrUpdate':
if (action_body.product_type == 0 && action_body.items) {
if (action_body.product_type == 1 && action_body.items) {
return system.getResult(null, '单产品不能有子产品')
}
if (action_body.product_type == 1 && (!action_body.items || action_body.items.length == 0)) {
if (action_body.product_type == 2 && (!action_body.items || action_body.items.length == 0)) {
return system.getResult(null, '未选择子产品')
}
if (action_body.product_type == 1) {
if (action_body.product_type == 2) {
let checkRes = await this.productSve.checkSitem(action_body.items)
if (!checkRes) {
return system.getResult(null, '不能选择组合产品为子产品')
}
}
if (isNaN(parseInt(action_body.limit))) {
return system.getResult(null, `can't use limit of except number`)
} else {
action_body.limit = parseInt(action_body.limit)
}
if (isNaN(parseInt(action_body.page))) {
return system.getResult(null, `can't use page of except number`)
} else {
action_body.page = parseInt(action_body.page)
}
result = await this.productSve.createOrUpdate(action_body)
break
case 'getAllDic':
......
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