Эх сурвалжийг харах

Merge branch 'dev2.6' of http://192.168.3.207:10080/qmx/qfw into dev2.6

zhangxinlei1996 6 жил өмнө
parent
commit
dbcb1d6d31

+ 24 - 0
common/src/qfw/util/jy.go

@@ -0,0 +1,24 @@
+package util
+
+func GetOldOpenid(s_m_openid, a_m_openid, s_phone string, a_mergeorder []interface{}) string {
+	openid := ""
+	if len(a_mergeorder) > 0 {
+		first, _ := a_mergeorder[0].(string)
+		if first == "s_m_openid" {
+			openid = s_m_openid
+		} else if first == "a_m_openid" {
+			openid = a_m_openid
+		} else if first == "s_phone" {
+			openid = s_phone
+		}
+	} else {
+		if s_m_openid != "" {
+			openid = s_m_openid
+		} else if a_m_openid != "" {
+			openid = a_m_openid
+		} else if s_phone != "" {
+			openid = s_phone
+		}
+	}
+	return openid
+}

+ 19 - 10
core/src/qfw/manage/feedback.go

@@ -189,7 +189,9 @@ func (s *SystemManage) Updateback() error {
 			//
 			f := FindOne("user", "{'_id':'"+s_submitid+"'}")
 			if (*f)["s_m_openid"] != nil {
-				openid := (*f)["s_m_openid"].(string)
+				s_m_openid := (*f)["s_m_openid"].(string)
+				a_m_openid := (*f)["a_m_openid"].(string)
+				s_phone := (*f)["s_phone"].(string)
 				opinion := s.GetString("s_opinion")
 				if (*f)["i_appid"] == 2 {
 					userType := util.IntAll((*f)["i_type"])
@@ -198,7 +200,7 @@ func (s *SystemManage) Updateback() error {
 					//微信发送模板消息
 					isWxReply, isAppReply := false, false
 					if s_from == "" {
-						if userType == 0 && openid != "" {
+						if userType == 0 && s_m_openid != "" {
 							isWxReply = true
 						}
 						//app推送极光消息
@@ -210,33 +212,40 @@ func (s *SystemManage) Updateback() error {
 							isAppReply = true
 						}
 					} else if s_from == "wx" {
-						if openid != "" {
+						if s_m_openid != "" {
 							isWxReply = true
 						}
 					}
 					if isWxReply {
-						msgurl := coreconfig.SysConfig.JyWebdomain + "/front/sess/" + seTopnet.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
+						msgurl := coreconfig.SysConfig.JyWebdomain + "/front/sess/" + seTopnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
 						s_result := "剑鱼客服回复了您的问题!"
 						s_detail := "问题回复"
 						s_remark := "  " + opinion
 						s_submitdate := s.GetString("l_submitdate")
-						log.Println("微信模板消息-意见反馈答复", openid)
-						coreutil.JyWeixinRpc.SendFeedbackNotifyMsg(&qrpc.NotifyMsg{Openid: openid, Title: s_result, Detail: s_detail, Date: s_submitdate, Remark: s_remark, Url: msgurl})
+						log.Println("微信模板消息-意见反馈答复", s_m_openid)
+						coreutil.JyWeixinRpc.SendFeedbackNotifyMsg(&qrpc.NotifyMsg{Openid: s_m_openid, Title: s_result, Detail: s_detail, Date: s_submitdate, Remark: s_remark, Url: msgurl})
 					}
 					if isAppReply {
-						msgurl := "/jyapp/free/sess/" + seTopnet.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
+						sess_openid := a_m_openid
+						if sess_openid == "" {
+							sess_openid = s_phone
+						}
+						if sess_openid == "" {
+							sess_openid = s_m_openid
+						}
+						msgurl := "/jyapp/free/sess/" + seTopnet.EncodeString(sess_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
 						ponetype, _ := (*f)["s_appponetype"].(string)
 						if jpushid != "" || opushid != "" {
 							if len([]rune(opinion)) > 80 {
 								opinion = string([]rune(opinion)[:80]) + "..."
 							}
-							log.Println("极光推送-意见反馈答复", openid, jpushid)
+							log.Println("极光推送-意见反馈答复", sess_openid, jpushid)
 							go coreutil.AppPushServiceCall(map[string]interface{}{
 								"phoneType":   ponetype,
 								"otherPushId": opushid,
 								"jgPushId":    jpushid,
 								"url":         msgurl,
-								"openId":      openid,
+								"openId":      sess_openid,
 								"userId":      s_submitid,
 								"type":        "feedback",
 								"descript":    opinion,
@@ -254,7 +263,7 @@ func (s *SystemManage) Updateback() error {
 					s_detail := "以下是对你提交“" + title + "”意见的回复结果"
 					s_remark := "  " + opinion
 					go func() {
-						coreutil.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: openid, Title: s_result, Detail: s_detail, Remark: s_remark})
+						coreutil.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: s_m_openid, Title: s_result, Detail: s_detail, Remark: s_remark})
 					}()
 				}
 			}