Эх сурвалжийг харах

Merge branch 'cygx_12.1' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 жил өмнө
parent
commit
4a0772dfce

+ 4 - 2
models/questionnaire.go

@@ -3,6 +3,8 @@ package models
 import (
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
+	"hongze/hongze_cygx/utils"
+	"time"
 )
 
 type AddCygxQuestionnaireThemeReq struct {
@@ -54,8 +56,8 @@ func GetCygxQuestionnaireCount(condition string, pars []interface{}) (count int,
 // 通过ID获取详情
 func GetCygxQuestionnaireDetailBestNew() (item *CygxQuestionnaireResp, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_questionnaire ORDER BY publish_time DESC LIMIT 1     `
-	err = o.Raw(sql).QueryRow(&item)
+	sql := `SELECT * FROM cygx_questionnaire WHERE end_time >= ? ORDER BY publish_time DESC LIMIT 1     `
+	err = o.Raw(sql, time.Now().Format(utils.FormatDate)).QueryRow(&item)
 	return
 }