|
@@ -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
|
|
|
}
|
|
|
|