Forráskód Böngészése

fix:修改转换年龄

jimmyyem 6 napja
szülő
commit
264be30819

+ 3 - 1
crontask/send_wx.go

@@ -194,7 +194,9 @@ func varReplace(s string, contactInfo *ent.Contact) string {
 			sex = "女"
 		}
 		age := contactInfo.Cage
-		cage = strconv.Itoa(age)
+		if age > 0 {
+			cage = strconv.Itoa(age)
+		}
 	}
 	s = strings.Replace(s, "${nickname}", nickname, -1)
 	s = strings.Replace(s, "${cname}", cname, -1)

+ 3 - 1
internal/logic/sop_task/publish_sop_task_logic.go

@@ -451,7 +451,9 @@ func varReplace(s string, contactInfo *ent.Contact) string {
 			sex = "女"
 		}
 		age := contactInfo.Cage
-		cage = strconv.Itoa(age)
+		if age > 0 {
+			cage = strconv.Itoa(age)
+		}
 	}
 
 	s = strings.Replace(s, "${nickname}", nickname, -1)