新增了飞花令数量1
This commit is contained in:
@@ -333,6 +333,7 @@ func (r *QuestionQaService) PutQuestionQa(qaId int64, req requests.PutQuestionQa
|
||||
return false, err
|
||||
}
|
||||
|
||||
fmt.Println(1111)
|
||||
// 题目数量
|
||||
if qaQuantity != questionQa.QaQuantity {
|
||||
if req.Action == 1 {
|
||||
@@ -764,7 +765,7 @@ func (r *QuestionQaService) CheckPutQaQuestionQuantity(req requests.PutQuestionQ
|
||||
itemQuantity = 0
|
||||
for _, item := range req.QuestionQaItem {
|
||||
if content.QuestionType == item.QuestionType {
|
||||
itemQuantity = item.Quantity
|
||||
itemQuantity = itemQuantity + item.Quantity
|
||||
}
|
||||
}
|
||||
|
||||
@@ -795,12 +796,16 @@ func (r *QuestionQaService) CheckPutQaQuestionQuantity(req requests.PutQuestionQ
|
||||
itemQuantity = 0
|
||||
for _, item := range req.QuestionQaItem {
|
||||
if content.QuestionType == item.QuestionType {
|
||||
itemQuantity = item.Quantity
|
||||
itemQuantity = itemQuantity + item.Quantity
|
||||
}
|
||||
}
|
||||
|
||||
quantity := content.Quantity * *req.TokenNum * *req.RoundNum
|
||||
|
||||
fmt.Println(utils.QuestionType(content.QuestionType))
|
||||
fmt.Println(quantity)
|
||||
fmt.Println(req.QuestionQaItem)
|
||||
fmt.Println(itemQuantity)
|
||||
if quantity > itemQuantity {
|
||||
return qaQuantity, errors.New(utils.QuestionType(content.QuestionType) + "数量不足")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user