zhangxinlei1996 4 years ago
parent
commit
06eb4f598c
1 changed files with 5 additions and 3 deletions
  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