|
@@ -520,12 +520,20 @@ func Subscribe(w ResponseWriter, r *Request) {
|
|
|
log.Println(err)
|
|
|
return
|
|
|
}
|
|
|
- var source = ""
|
|
|
+ var (
|
|
|
+ source, biddingTitle, biddingUrl, subTxt string
|
|
|
+ )
|
|
|
if strings.Count(r.EventKey, "_") == 1 {
|
|
|
source = strings.Split(r.EventKey, "_")[1]
|
|
|
} else if strings.Count(r.EventKey, "_") >= 2 {
|
|
|
source = strings.SplitN(r.EventKey, "_", 2)[1]
|
|
|
}
|
|
|
+ //小程序 二维码 关注对应的招标信息
|
|
|
+ if strings.Contains(r.EventKey, "ac_") {
|
|
|
+ id := strings.Split(r.EventKey, "ac_")[1]
|
|
|
+ source = fmt.Sprintf("ac_%s", id)
|
|
|
+ biddingTitle, biddingUrl, subTxt = tools.GetMiniActivateBiddingInfo(id)
|
|
|
+ }
|
|
|
go saveFixedCode(openid, r.Event, source)
|
|
|
log.Println("source:", source, "---", r.EventKey)
|
|
|
var shareData interface{}
|
|
@@ -704,6 +712,10 @@ func Subscribe(w ResponseWriter, r *Request) {
|
|
|
if text := service.KeyPhraseReply(openid, source, "sub"); text != "" {
|
|
|
w.ReplyText(text)
|
|
|
}
|
|
|
+ //P583
|
|
|
+ if biddingUrl != "" && biddingTitle != "" {
|
|
|
+ w.ReplyText(fmt.Sprintf(config.Sysconfig["miniProgramActivateReplyText"].(string), user.Nickname, subTxt, biddingUrl, biddingTitle))
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func saveUserLog(shareId, openid, activeName string, shareflag bool) {
|