Преглед изворни кода

Merge branch 'crm_15.7' into debug

zwxi пре 10 месеци
родитељ
комит
fc027b3544
1 измењених фајлова са 7 додато и 3 уклоњено
  1. 7 3
      controller/public.go

+ 7 - 3
controller/public.go

@@ -522,18 +522,22 @@ func BannerHistoryList(c *gin.Context) {
 // @Failure 400 {string} string 请输入邮箱地址
 // @Router /banner/get_qrcode [get]
 func BannerGetQRCode(c *gin.Context) {
-	userId, _ := strconv.Atoi(c.Query("userId"))
+	userId, _ := strconv.Atoi(c.Query("UserId"))
+	bannerId, _ := strconv.Atoi(c.Query("BannerId"))
 	wxUserInfo, err := wx_user.GetByUserId(userId)
 	if err != nil {
+		response.Fail(err.Error(), c)
 		return
 	}
 	companyInfo, tmpErr := company.GetByCompanyId(wxUserInfo.CompanyID)
 	if tmpErr != nil {
 		err = tmpErr
 		if tmpErr == utils.ErrNoRow {
+			response.Fail(err.Error(), c)
 			err = errors.New("找不到该客户")
 			return
 		}
+		response.Fail(err.Error(), c)
 		return
 	}
 	companyName := companyInfo.CompanyName
@@ -550,8 +554,8 @@ func BannerGetQRCode(c *gin.Context) {
 	randStr := utils.GetRandStringNoSpecialChar(28)
 	filePath := "./static/" + randStr + ".png"
 	fileName := randStr + ".png"
-	url := "pages-report/signUpPage/signUpPage&RealName?%s&CompanyName?%s&Mobile?%sBannerId?%s"
-	url = fmt.Sprintf(url, wxUserInfo.RealName, companyName, userDetail.Mobile)
+	url := "pages-report/signUpPage/signUpPage&RealName?%s&CompanyName?%s&Mobile?%s&BannerId?%s"
+	url = fmt.Sprintf(url, wxUserInfo.RealName, companyName, userDetail.Mobile, bannerId)
 
 	err = qrcode.WriteFile(url, qrcode.Medium, 256, filePath)
 	if err != nil {