Ver código fonte

fix:edit send_msg.go

jimmyyem 8 meses atrás
pai
commit
7ac68286d6
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      crontask/send_msg.go

+ 6 - 0
crontask/send_msg.go

@@ -30,6 +30,12 @@ func (l *CronTask) sendMsg() {
 		l.Logger.Info("batch start: ", batch.BatchNo)
 		// 如果 批次 status 为 0,则先产生待发送消息
 		if batch.Status == 0 {
+
+			// 如果是设定了发送时间,且还没到则应该忽略该条内容
+			if !batch.SendTime.IsZero() && time.Now().Before(batch.SendTime) {
+				continue
+			}
+
 			userlist := make([]*ent.Contact, 0)
 			if batch.Tag == "all" {
 				// 获取 contact 表中  wx_wxid 等于 req.Fromwxid 的 type 为1或2的数据