Răsfoiți Sursa

微路演设置有效时间为30天,失效后该活动就不再支持音频回放

xingzai 2 ani în urmă
părinte
comite
ae2ca3914e
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      services/micro_roadshow.go

+ 5 - 0
services/micro_roadshow.go

@@ -9,6 +9,7 @@ import (
 	"strconv"
 	"strings"
 	"sync"
+	"time"
 )
 
 // GetMicroRoadShowPageList 获取微路演列表
@@ -49,6 +50,10 @@ func GetMicroRoadShowPageList(pageSize, currentIndex, audioId, videoId int, keyw
 		var audioPars []interface{}
 		// 活动已发布且已结束
 		audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
+		//活动音频,设置有效时间为30天,失效后该活动就不再支持音频回放。有效期起始时间为活动的开始时间
+		endTime := time.Now().AddDate(0, 0, -30).Format("2006-01-02 15:04:05")
+		audioCond += ` AND b.activity_time > ? `
+		audioPars = append(audioPars, endTime)
 		if keywords != "" {
 			audioCond += ` AND a.voice_name LIKE ? OR b.label LIKE ?`
 			audioPars = append(audioPars, keywords, keywords)