ziwen há 2 anos atrás
pai
commit
34c883401f
2 ficheiros alterados com 6 adições e 2 exclusões
  1. 5 1
      controllers/advice.go
  2. 1 1
      models/advice.go

+ 5 - 1
controllers/advice.go

@@ -53,6 +53,10 @@ func (this *AdviceController) ApplyApprove() {
 		br.ErrMsg = "客户不存在,uid:" + strconv.Itoa(user.UserId)
 		return
 	}
+	var adviceImgUrl string
+	for _, s := range req.AdviceImgUrl {
+		adviceImgUrl += "#"+s
+	}
 	item := new(models.CygxAdvice)
 	item.UserId = user.UserId
 	item.UserRealName = user.RealName
@@ -60,7 +64,7 @@ func (this *AdviceController) ApplyApprove() {
 	item.CompanyName = companyDetail.CompanyName
 	item.SalesRealName = companyDetail.SellerName
 	item.Advice = req.Advice
-	item.AdviceImgUrl = req.AdviceImgUrl
+	item.AdviceImgUrl = adviceImgUrl
 	item.CreateTime = time.Now()
 	item.Mobile = user.Mobile
 	item.Email = user.Email

+ 1 - 1
models/advice.go

@@ -28,5 +28,5 @@ func AddCygxAdvice(item *CygxAdvice) (lastId int64, err error) {
 
 type AddCygxAdviceReq struct {
 	Advice       string `description:"优化建议"`
-	AdviceImgUrl string `description:"图片,多张用#分割"`
+	AdviceImgUrl []string `description:"图片,多张用#分割"`
 }