zhangxinlei1996 4 年之前
父节点
当前提交
06eb4f598c
共有 1 个文件被更改,包括 5 次插入3 次删除
  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