|
@@ -26,6 +26,7 @@ func (a *Adp) Run() {
|
|
now := time.Now()
|
|
now := time.Now()
|
|
nowStart := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
|
|
nowStart := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
|
|
end := nowStart.AddDate(0, 0, Config.Messages.AdpExpire.ExpireDay-1)
|
|
end := nowStart.AddDate(0, 0, Config.Messages.AdpExpire.ExpireDay-1)
|
|
|
|
+ endTime := date.FormatDate(&end, date.Date_Full_Layout)
|
|
all := map[string]int{}
|
|
all := map[string]int{}
|
|
lock := &sync.Mutex{}
|
|
lock := &sync.Mutex{}
|
|
Tidb.SelectByBath(1, func(l *[]map[string]interface{}) bool {
|
|
Tidb.SelectByBath(1, func(l *[]map[string]interface{}) bool {
|
|
@@ -49,7 +50,7 @@ func (a *Adp) Run() {
|
|
lock.Unlock()
|
|
lock.Unlock()
|
|
}(util.ObjToString((*l)[0]["accountId"]), util.IntAll((*l)[0]["sourceType"]), util.IntAll((*l)[0]["number"]))
|
|
}(util.ObjToString((*l)[0]["accountId"]), util.IntAll((*l)[0]["sourceType"]), util.IntAll((*l)[0]["number"]))
|
|
return true
|
|
return true
|
|
- }, `select accountId,sourceType,number from jy_user_center.account_resources where name='附件下载包' and endTime=?`, date.FormatDate(&end, date.Date_Full_Layout))
|
|
|
|
|
|
+ }, `select accountId,sourceType,number from jy_user_center.account_resources where name='附件下载包' and endTime=?`, endTime)
|
|
wait.Wait()
|
|
wait.Wait()
|
|
for k, v := range all {
|
|
for k, v := range all {
|
|
pool <- true
|
|
pool <- true
|
|
@@ -71,16 +72,27 @@ func (a *Adp) Run() {
|
|
}
|
|
}
|
|
wxUrl := "/front/sess/" + Se.EncodeString(accountId+","+util.If(IsObjectIdHex(accountId), "_id", "positionId").(string)+","+strconv.Itoa(int(time.Now().Unix()))+",") + "__" + Se.EncodeString(Config.Messages.AdpExpire.MobileUrl)
|
|
wxUrl := "/front/sess/" + Se.EncodeString(accountId+","+util.If(IsObjectIdHex(accountId), "_id", "positionId").(string)+","+strconv.Itoa(int(time.Now().Unix()))+",") + "__" + Se.EncodeString(Config.Messages.AdpExpire.MobileUrl)
|
|
appUrl := "/jyapp/free/sess/" + Se.EncodeString(accountId+","+util.If(IsObjectIdHex(accountId), "_id", "positionId").(string)+","+strconv.Itoa(int(time.Now().Unix()))+",") + "__" + Se.EncodeString(Config.Messages.AdpExpire.MobileUrl)
|
|
appUrl := "/jyapp/free/sess/" + Se.EncodeString(accountId+","+util.If(IsObjectIdHex(accountId), "_id", "positionId").(string)+","+strconv.Itoa(int(time.Now().Unix()))+",") + "__" + Se.EncodeString(Config.Messages.AdpExpire.MobileUrl)
|
|
|
|
+ title := fmt.Sprintf(Config.Messages.AdpExpire.Title, Config.Messages.AdpExpire.ExpireDay)
|
|
|
|
+ content := fmt.Sprintf(Config.Messages.AdpExpire.Content, Config.Messages.AdpExpire.ExpireDay, number)
|
|
SendMsg(&message.MultipleSaveMsgReq{
|
|
SendMsg(&message.MultipleSaveMsgReq{
|
|
UserIds: mgoUserId,
|
|
UserIds: mgoUserId,
|
|
- Title: fmt.Sprintf(Config.Messages.AdpExpire.Title, Config.Messages.AdpExpire.ExpireDay),
|
|
|
|
- Content: fmt.Sprintf(Config.Messages.AdpExpire.Content, Config.Messages.AdpExpire.ExpireDay, number),
|
|
|
|
|
|
+ Title: title,
|
|
|
|
+ Content: content,
|
|
MsgType: Config.Messages.AdpExpire.MsgType,
|
|
MsgType: Config.Messages.AdpExpire.MsgType,
|
|
Link: Config.Messages.AdpExpire.PcUrl + "," + Config.Messages.AdpExpire.MobileUrl + "," + Config.Messages.AdpExpire.MobileUrl,
|
|
Link: Config.Messages.AdpExpire.PcUrl + "," + Config.Messages.AdpExpire.MobileUrl + "," + Config.Messages.AdpExpire.MobileUrl,
|
|
Appid: Config.Messages.AdpExpire.Appid,
|
|
Appid: Config.Messages.AdpExpire.Appid,
|
|
AppPushUrl: appUrl,
|
|
AppPushUrl: appUrl,
|
|
WxPushUrl: Config.Webdomain + wxUrl,
|
|
WxPushUrl: Config.Webdomain + wxUrl,
|
|
IosPushUrl: appUrl,
|
|
IosPushUrl: appUrl,
|
|
|
|
+ CustomWxTpl: &message.CustomWxTpl{
|
|
|
|
+ TplId: Config.Messages.AdpExpire.WxTplId,
|
|
|
|
+ TmplData: map[string]*message.TmplItem{
|
|
|
|
+ "thing15": &message.TmplItem{Value: title},
|
|
|
|
+ "thing6": &message.TmplItem{Value: content},
|
|
|
|
+ "time12": &message.TmplItem{Value: endTime},
|
|
|
|
+ "thing11": &message.TmplItem{Value: "兑换权益即将到期,请尽快使用。"},
|
|
|
|
+ },
|
|
|
|
+ },
|
|
})
|
|
})
|
|
}(k, v)
|
|
}(k, v)
|
|
}
|
|
}
|