Răsfoiți Sursa

微信邀请

zhanghongbo 9 ani în urmă
părinte
comite
c73cc8f1db
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      weixin/src/qfw/weixin/msgtxtchandler.go

+ 4 - 1
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -40,6 +40,7 @@ func InitRobotHttpClient() {
 //文本消息处理
 func MsgTxtHandler(w ResponseWriter, r *Request) {
 	openid := r.FromUserName
+	//log.Println("........", r.FromUserName, r.Content)
 	//在会话中
 	if us, ok := UserSession[openid]; ok {
 		if r.Content == "q" || r.Content == "Q" {
@@ -68,7 +69,7 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 		w.ReplyNews([]Article{Article{PicUrl: wf.SysConfig.Activity["picurl"], Title: wf.SysConfig.Activity["title"], Url: targeturl}})
 	} else if strings.HasPrefix(r.Content, "内部报名") { //绑定拓普员工姓名
 		tmp := strings.Fields(r.Content)
-		log.Println(tmp, len(tmp))
+		//log.Println(tmp, len(tmp))
 		if len(tmp) != 2 {
 			w.ReplyText("请按以下格式输入:内部报名 姓名")
 		} else {
@@ -79,7 +80,9 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 			}
 		}
 	} else if r.Content == "成果查询" { //查询我的邀请人数
+		//log.Println(r.FromUserName, "查询成果")
 		total := dao.GetMyInvitePersons(r.FromUserName)
+		//log.Println(r.FromUserName, total)
 		w.ReplyText(fmt.Sprintf("感谢您,已经成功邀请%d个用户", total))
 	} else {
 		//属于在线咨询,暂时直接中转到微信客服系统