|
@@ -40,7 +40,7 @@ func GetPageList(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
func _handleListQuery(c *gin.Context) (string, []interface{}, string) {
|
|
|
- condition := "is_delete = 0"
|
|
|
+ condition := "is_delete = 0 AND publish_status = 1"
|
|
|
pars := make([]interface{}, 0)
|
|
|
// 活动类别/标题
|
|
|
reqTitle := c.DefaultQuery("title", "")
|
|
@@ -53,22 +53,11 @@ func _handleListQuery(c *gin.Context) (string, []interface{}, string) {
|
|
|
reqState := c.DefaultQuery("active_state", "0")
|
|
|
if reqState != "0" {
|
|
|
state, _ := strconv.Atoi(reqState)
|
|
|
- nowTime := time.Now().Format("2006-01-02 15:04:05")
|
|
|
- weekStart := utils.GetNowWeekMonday()
|
|
|
- weekEnd := utils.GetNowWeekLastDay()
|
|
|
- // 比对本周开始时间和当前时间
|
|
|
- timeNow, _ := time.ParseInLocation("2006-01-02 15:04:05", nowTime, time.Local)
|
|
|
- queryStart := timeNow
|
|
|
- if timeNow.Before(weekStart) {
|
|
|
- queryStart = weekStart
|
|
|
- }
|
|
|
+ nowTime := time.Now().Format(utils.FormatDateTime)
|
|
|
switch state {
|
|
|
case 1:
|
|
|
- // 时间在本周内且未开始
|
|
|
- condition += ` AND start_time >= ?`
|
|
|
- pars = append(pars, queryStart)
|
|
|
- condition += ` AND end_time < ?`
|
|
|
- pars = append(pars, weekEnd)
|
|
|
+ condition += ` AND start_time > ?`
|
|
|
+ pars = append(pars, nowTime)
|
|
|
case 2:
|
|
|
condition += ` AND start_time <= ?`
|
|
|
pars = append(pars, nowTime)
|
|
@@ -77,6 +66,7 @@ func _handleListQuery(c *gin.Context) (string, []interface{}, string) {
|
|
|
case 3:
|
|
|
condition += ` AND end_time < ?`
|
|
|
pars = append(pars, nowTime)
|
|
|
+ order = "start_time desc"
|
|
|
}
|
|
|
}
|
|
|
reqType := c.DefaultQuery("activity_type", "0")
|