|
@@ -47,21 +47,23 @@ func (w *ExhibitionStruct) GetExhibitionActiveHref(email, phone, source string,
|
|
|
log.Println("phone-----:", session.Get("phone"), "-----", userId)
|
|
|
//留资福利 及 留资后跳转地址
|
|
|
if res := w.ExhibitionActive("", source, session, "second_ad_code,guide_page,welfare_type,welfare_content"); res != nil {
|
|
|
- //供 文库 获取福利 使用 NSQ 通信
|
|
|
- go func(userId string, res map[string]interface{}) {
|
|
|
- key := fmt.Sprintf("exhibition_active_%s", userId)
|
|
|
- log.Println("----key----:", key)
|
|
|
- if redis.Incr("newother", key) == 1 {
|
|
|
- _ = redis.SetExpire("newother", key, Sysconfig.ExhibitionTimeOut)
|
|
|
- err := jy.Publish(Mgo_Log, Sysconfig.Nsq, Sysconfig.NsqTopic, jy.Jywx_exhibition_active, userId, jy.Jywx_node1, map[string]interface{}{
|
|
|
- "welfareType": res["welfare_type"],
|
|
|
- "welfareContent": res["welfare_content"],
|
|
|
- })
|
|
|
- if err != nil {
|
|
|
- log.Println("nsq队列写入失败-->", "jy_docs_exhibition_active", userId)
|
|
|
+ if util.IntAll(res["welfare_type"]) > 0 { // welfare_type 大于0 时有奖励
|
|
|
+ //供 文库 获取福利 使用 NSQ 通信
|
|
|
+ go func(userId string, res map[string]interface{}) {
|
|
|
+ key := fmt.Sprintf("exhibition_active_%s_%s", source, userId)
|
|
|
+ log.Println("----key----:", key)
|
|
|
+ if redis.Incr("newother", key) == 1 {
|
|
|
+ _ = redis.SetExpire("newother", key, Sysconfig.ExhibitionTimeOut)
|
|
|
+ err := jy.Publish(Mgo_Log, Sysconfig.Nsq, Sysconfig.NsqTopic, jy.Jywx_exhibition_active, userId, jy.Jywx_node1, map[string]interface{}{
|
|
|
+ "welfareType": res["welfare_type"],
|
|
|
+ "welfareContent": res["welfare_content"],
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ log.Println("nsq队列写入失败-->", "jy_docs_exhibition_active", source, userId)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }(userId, res)
|
|
|
+ }(userId, res)
|
|
|
+ }
|
|
|
href = util.ObjToString(res["toDirect"])
|
|
|
if token != "" {
|
|
|
href = fmt.Sprintf("%s?%stoDirect=%s", MergeUrl, fmt.Sprintf("token=%s&", token), href)
|