Browse Source

Merge branch 'dev_v4.9.69_wh1' of qmx/jy into feature/v4.9.69

王浩 8 months ago
parent
commit
7788403b85

+ 0 - 1
src/jfw/modules/publicapply/src/go.mod

@@ -2,7 +2,6 @@ module jy/src/jfw/modules/publicapply/src
 
 go 1.21
 
-toolchain go1.22.0
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66

+ 18 - 7
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -156,15 +156,26 @@ func (this *ParamInfo) HistorySearch(userId string) (string, string, string) {
 	if len(browseArr) == 0 {
 		return "", "", ""
 	}
+	area, city, district := "", "", ""
 	for _, v := range browseArr {
-		area := gconv.String(v["area"])
-		city := gconv.String(v["city"])
-		district := gconv.String(v["district"])
-		if area != "" && area != "全国" {
-			return area, city, district
+		area = gconv.String(v["area"])
+		city = gconv.String(v["city"])
+		district = gconv.String(v["district"])
+		if area == "" || area != "全国" {
+			continue
+		}
+	}
+	if area != "" {
+		if district == "" && city == "" {
+			return area, "", ""
+		} else if city == "" && district != "" {
+			return area, "", district
+		} else if district == "" && city != "" {
+			return area, city, ""
 		}
 	}
-	return "", "", ""
+	// 如果都不满足条件,返回 district 和 city
+	return area, city, district
 }
 
 type UserSubMsg struct {
@@ -329,7 +340,7 @@ func (pi *ParamInfo) AreaPackTip() map[string]interface{} {
 		if o_jy["o_area"] != nil {
 			oarea, _ := o_jy["o_area"].(map[string]interface{})
 			if len(oarea) > 0 {
-				for k, _ := range oarea {
+				for k := range oarea {
 					m["area"] = k
 					break
 				}