zhangxinlei1996 před 4 roky
rodič
revize
06eb4f598c
1 změnil soubory, kde provedl 5 přidání a 3 odebrání
  1. 5 3
      src/jfw/front/pcIndex.go

+ 5 - 3
src/jfw/front/pcIndex.go

@@ -428,7 +428,7 @@ func (f *PcIndex) SearchResult(at, name string) error {
 					*datas = (*datas)[0:limitcount]
 				}
 			}
-			if len(*datas) > 0 && datas != nil {
+			if datas != nil && len(*datas) > 0 {
 				for _, v := range *datas {
 					v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
 				}
@@ -439,8 +439,10 @@ func (f *PcIndex) SearchResult(at, name string) error {
 			b, _ := json.Marshal(list)
 			json.Unmarshal(b, &datas)
 		}
-		public.BidListConvert(industry, datas)
-		res = searchresulthtml(datas)
+		if datas != nil && len(*datas) > 0 {
+			public.BidListConvert(industry, datas)
+			res = searchresulthtml(datas)
+		}
 		f.T["res"] = res
 		f.T["area"] = area
 		f.T["stype"] = stype