xingzai 3 anni fa
parent
commit
f5af5929ae
2 ha cambiato i file con 24 aggiunte e 12 eliminazioni
  1. 18 9
      controllers/article.go
  2. 6 3
      controllers/report.go

+ 18 - 9
controllers/article.go

@@ -196,16 +196,25 @@ func (this *ArticleController) Detail() {
 			return
 		}
 		if detail.ArticleId >= utils.SummaryArticleId {
-			var hrefRegexp = regexp.MustCompile("[0-9]\\d*")
-			match := hrefRegexp.FindAllString(detail.SellerAndMobile, -1)
-			if match != nil {
-				for _, v := range match {
-					sellerAndMobile := &models.SellerRep{
-						SellerMobile: v,
-						SellerName:   strings.Replace(detail.SellerAndMobile, v, "", -1),
-					}
-					sellerList = append(sellerList, sellerAndMobile)
+			//var hrefRegexp = regexp.MustCompile("[0-9]\\d*")
+			//match := hrefRegexp.FindAllString(detail.SellerAndMobile, -1)
+			//if match != nil {
+			//	for _, v := range match {
+			//		sellerAndMobile := &models.SellerRep{
+			//			SellerMobile: v,
+			//			SellerName:   strings.Replace(detail.SellerAndMobile, v, "", -1),
+			//		}
+			//		sellerList = append(sellerList, sellerAndMobile)
+			//	}
+			//}
+			strnum := strings.Index(detail.SellerAndMobile, "-")
+			if strnum > 0 {
+				nickName := detail.SellerAndMobile[0:strnum]
+				sellerAndMobile := &models.SellerRep{
+					SellerMobile: "",
+					SellerName:   nickName,
 				}
+				sellerList = append(sellerList, sellerAndMobile)
 			}
 		}
 		detail.SellerList = sellerList

+ 6 - 3
controllers/report.go

@@ -669,9 +669,10 @@ func (this *ReportController) IndustryListByDepartment() {
 				}
 				listDepar[k2].SubjectName = strings.TrimRight(listDepar[k2].SubjectName, "/")
 			}
-			listDepar[k2].IndustryName += "-" + listDepar[k2].SubjectName
+			if listDepar[k2].SubjectName != "" {
+				listDepar[k2].IndustryName += "-" + listDepar[k2].SubjectName
+			}
 		}
-
 		list[k].List = listDepar
 		if v.FollowNum > 0 {
 			list[k].IsMyFollow = true
@@ -862,7 +863,9 @@ func (this *ReportController) ReportList() {
 			}
 		}
 		list[k].SubjectName = strings.TrimRight(list[k].SubjectName, "/")
-		list[k].IndustryName += "-" + list[k].SubjectName
+		if list[k].SubjectName != "" {
+			list[k].IndustryName += "-" + list[k].SubjectName
+		}
 		resp.NickName = v.NickName
 		resp.IndustryName = v.IndustryName
 	}