|
@@ -443,13 +443,13 @@ func (f *Front) Topics() error {
|
|
|
userId, _ := f.GetSession("userId").(string)
|
|
|
f.DisableHttpCache()
|
|
|
//底部最新招标数据 3*6 条信息
|
|
|
- news := PCS_list("", 18, userId).([]interface{}) //Newbids("")[0].([]interface{})
|
|
|
+ news := PCS_list("", 18, userId) //Newbids("")[0].([]interface{})
|
|
|
listAll := [][]map[string]interface{}{}
|
|
|
i := 1
|
|
|
list := []map[string]interface{}{}
|
|
|
now := time.Now().Unix()
|
|
|
- for _, v := range news {
|
|
|
- if data, ok := v.(map[string]interface{}); ok {
|
|
|
+ if news != nil {
|
|
|
+ for _, data := range news {
|
|
|
if data["publishtime"] == nil && data["time"] != nil {
|
|
|
continue
|
|
|
}
|
|
@@ -463,14 +463,14 @@ func (f *Front) Topics() error {
|
|
|
data["index"] = i
|
|
|
i++
|
|
|
list = append(list, data)
|
|
|
- }
|
|
|
- if len(list) >= 6 {
|
|
|
- listAll = append(listAll, list)
|
|
|
- list = []map[string]interface{}{}
|
|
|
- i = 1
|
|
|
- }
|
|
|
- if len(listAll) >= 3 {
|
|
|
- break
|
|
|
+ if len(list) >= 6 {
|
|
|
+ listAll = append(listAll, list)
|
|
|
+ list = []map[string]interface{}{}
|
|
|
+ i = 1
|
|
|
+ }
|
|
|
+ if len(listAll) >= 3 {
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
f.T["list"] = listAll
|