浏览代码

研报 定时任务

xyxie 1 年之前
父节点
当前提交
70aefb44a2
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 10 0
      models/db.go
  2. 1 1
      services/report.go

+ 10 - 0
models/db.go

@@ -106,6 +106,9 @@ func init() {
 	// ETA商家数据表
 	initEtaBusiness()
 
+	//英文研报
+	initEnglishReport()
+
 	// ETA商家配置表
 	initEtaBusinessConf()
 }
@@ -229,3 +232,10 @@ func initEtaBusinessConf() {
 		new(BusinessConf),
 	)
 }
+
+// initEnglishReport 英文研报
+func initEnglishReport() {
+	orm.RegisterModel(
+		new(EnglishReport),
+	)
+}

+ 1 - 1
services/report.go

@@ -254,7 +254,7 @@ func PublishReport(cont context.Context) (err error) {
 	now := time.Now().Format(utils.FormatDateTimeMinute)
 	startTime := now + ":00"
 	endTime := now + ":59"
-	afterDate := time.Now().AddDate(0, -1, 0).Format(utils.FormatDate) //限制一下,只查询最近一个月的
+	afterDate := time.Now().AddDate(0, -2, 0).Format(utils.FormatDate) //限制一下,只查询最近两个月的
 	list, e := models.GetPrePublishedReports(startTime, endTime, afterDate)
 	if e != nil {
 		return