zhou.xiaoning 2 lat temu
rodzic
commit
584cf5472b
2 zmienionych plików z 6 dodań i 6 usunięć
  1. 5 5
      models/common.go
  2. 1 1
      models/wrTrade2.go

+ 5 - 5
models/common.go

@@ -1223,9 +1223,9 @@ type QueryNewTitlesRsp struct {
 func GetNewTitles(req QueryNewTitlesReq) (rsp []QueryNewTitlesRsp, total int64, err error) {
 	engine := db.GetEngine()
 
-	session := engine.Table("SITE_COLUMNDETAIL")
+	session := engine.Table("SITE_COLUMNDETAIL").Where("ISSHOW = 1")
 	if req.COLUMNID != 0 {
-		session = session.Where("COLUMNID = ?", req.COLUMNID)
+		session = session.And("COLUMNID = ?", req.COLUMNID)
 	}
 	total, err = session.Count(new(QueryNewTitlesRsp))
 	if err != nil {
@@ -1233,9 +1233,9 @@ func GetNewTitles(req QueryNewTitlesReq) (rsp []QueryNewTitlesRsp, total int64,
 	}
 
 	rsp = make([]QueryNewTitlesRsp, 0)
-	session = engine.Table("SITE_COLUMNDETAIL")
+	session = engine.Table("SITE_COLUMNDETAIL").Where("ISSHOW = 1")
 	if req.COLUMNID != 0 {
-		session = session.Where("COLUMNID = ?", req.COLUMNID)
+		session = session.And("COLUMNID = ?", req.COLUMNID)
 	}
 	session = session.Desc("ISTOP", "PUBLISHDATE")
 	page := req.Page - 1
@@ -1285,7 +1285,7 @@ func GetNewContents(ids []string) (rsp []QueryNewContentsRsp, error error) {
 			GM.MEMBERNAME,
 			GM.MEMBERTAGS,
 			GM.IMAGEURL
-			`).Join("LEFT", "GZ_MEMBERINFO GM", "GM.MEMBERID = T.SRCID")
+			`).Join("LEFT", "GZ_MEMBERINFO GM", "GM.MEMBERID = T.SRCID").Where("T.ISSHOW = 1")
 	if len(ids) != 0 {
 		session = session.In("T.ID", ids)
 	}

+ 1 - 1
models/wrTrade2.go

@@ -4345,7 +4345,7 @@ func (r *Sitecolumnconfig) buildSql() string {
 	where %v 
 	order by t.SORT
 	`
-	param := "1=1"
+	param := "ISSHOW=1"
 	if r.COLUMNTYPE > 0 {
 		param = fmt.Sprintf("t.COLUMNTYPE = %v", r.COLUMNTYPE)
 	}