浏览代码

核销校验

k.zhang 2 周之前
父节点
当前提交
78634d9524
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      apis/shanghu/active.pay.go

+ 7 - 0
apis/shanghu/active.pay.go

@@ -358,6 +358,10 @@ func GroupBuyCancel(c *gin.Context) {
 		fmt.Println("projectInfo.CancelNum = ", projectInfo.CancelNum)
 		fmt.Println("v.CancelNum = ", v.CancelNum)
 
+		if v.CancelNum <= 0 {
+			continue
+		}
+
 		if projectInfo.CancelNum >= cancelNum+v.CancelNum && v.CancelNum > 0 {
 			isCancel = true
 			for i := 0; i < v.CancelNum; i++ {
@@ -371,6 +375,9 @@ func GroupBuyCancel(c *gin.Context) {
 
 				activeCancelLogList = append(activeCancelLogList, activeCancelLogInfo)
 			}
+		} else {
+			app.Error(c, 500, errors.New("核销次数不够"), "核销次数不够")
+			return
 		}
 
 	}