|
@@ -100,7 +100,7 @@ func (s *SystemManage) Feedbackcontent(_id string) error {
|
|
if u_type == 0 {
|
|
if u_type == 0 {
|
|
r := FindById("interaction", _id, `{"i_type":1,"l_submitdate":1,"s_submitid":1,"s_submitname":1,"s_remark":1,
|
|
r := FindById("interaction", _id, `{"i_type":1,"l_submitdate":1,"s_submitid":1,"s_submitname":1,"s_remark":1,
|
|
"s_pic":1,"s_enterprisetype":1,"_id":1,"s_link":1,"i_status":1,"s_title":1,
|
|
"s_pic":1,"s_enterprisetype":1,"_id":1,"s_link":1,"i_status":1,"s_title":1,
|
|
- "s_editorname":1,"s_opinion":1,"l_editordate":1,"s_record":1,"s_title_no":1,"s_source":1,"s_username":1}`)
|
|
|
|
|
|
+ "s_editorname":1,"s_opinion":1,"l_editordate":1,"s_record":1,"s_title_no":1,"s_source":1,"s_username":1,"s_from":1}`)
|
|
if nil != r {
|
|
if nil != r {
|
|
if util.IntAll((*r)["i_status"]) == 0 {
|
|
if util.IntAll((*r)["i_status"]) == 0 {
|
|
s_editorname, _ := s.GetSession("nickName").(string)
|
|
s_editorname, _ := s.GetSession("nickName").(string)
|
|
@@ -157,6 +157,7 @@ func (s *SystemManage) Updateback() error {
|
|
s_submitid := s.GetString("s_submitid")
|
|
s_submitid := s.GetString("s_submitid")
|
|
opinion := s.GetString("s_opinion")
|
|
opinion := s.GetString("s_opinion")
|
|
title := s.GetString("s_remark")
|
|
title := s.GetString("s_remark")
|
|
|
|
+ s_from := s.GetString("s_from")
|
|
if len(title) > 40 {
|
|
if len(title) > 40 {
|
|
title = front.SubstrByByte(title, 40)
|
|
title = front.SubstrByByte(title, 40)
|
|
}
|
|
}
|
|
@@ -188,36 +189,64 @@ func (s *SystemManage) Updateback() error {
|
|
//
|
|
//
|
|
f := FindOne("user", "{'_id':'"+s_submitid+"'}")
|
|
f := FindOne("user", "{'_id':'"+s_submitid+"'}")
|
|
if (*f)["s_m_openid"] != nil {
|
|
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")
|
|
opinion := s.GetString("s_opinion")
|
|
if (*f)["i_appid"] == 2 {
|
|
if (*f)["i_appid"] == 2 {
|
|
userType := util.IntAll((*f)["i_type"])
|
|
userType := util.IntAll((*f)["i_type"])
|
|
jpushid, _ := (*f)["s_jpushid"].(string)
|
|
jpushid, _ := (*f)["s_jpushid"].(string)
|
|
opushid, _ := (*f)["s_opushid"].(string)
|
|
opushid, _ := (*f)["s_opushid"].(string)
|
|
//微信发送模板消息
|
|
//微信发送模板消息
|
|
- if userType == 0 && openid != "" {
|
|
|
|
- msgurl := coreconfig.SysConfig.JyWebdomain + "/front/sess/" + seTopnet.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
|
|
|
|
|
|
+ isWxReply, isAppReply := false, false
|
|
|
|
+ if s_from == "" {
|
|
|
|
+ if userType == 0 && s_m_openid != "" {
|
|
|
|
+ isWxReply = true
|
|
|
|
+ }
|
|
|
|
+ //app推送极光消息
|
|
|
|
+ if (userType == 1 || userType == 2) && (jpushid != "" || opushid != "") {
|
|
|
|
+ isAppReply = true
|
|
|
|
+ }
|
|
|
|
+ } else if s_from == "app" {
|
|
|
|
+ if jpushid != "" || opushid != "" {
|
|
|
|
+ isAppReply = true
|
|
|
|
+ }
|
|
|
|
+ } else if s_from == "wx" {
|
|
|
|
+ if s_m_openid != "" {
|
|
|
|
+ isWxReply = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if isWxReply {
|
|
|
|
+ msgurl := coreconfig.SysConfig.JyWebdomain + "/front/sess/" + seTopnet.EncodeString(s_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
|
|
s_result := "剑鱼客服回复了您的问题!"
|
|
s_result := "剑鱼客服回复了您的问题!"
|
|
s_detail := "问题回复"
|
|
s_detail := "问题回复"
|
|
s_remark := " " + opinion
|
|
s_remark := " " + opinion
|
|
s_submitdate := s.GetString("l_submitdate")
|
|
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})
|
|
|
|
- } else if (userType == 1 || userType == 2) && (jpushid != "" || opushid != "") {
|
|
|
|
- //app推送极光消息
|
|
|
|
- msgurl := "/jyapp/free/sess/" + seTopnet.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",myfeedbacks")
|
|
|
|
|
|
+ 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 {
|
|
|
|
+ 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)
|
|
ponetype, _ := (*f)["s_appponetype"].(string)
|
|
if jpushid != "" || opushid != "" {
|
|
if jpushid != "" || opushid != "" {
|
|
if len([]rune(opinion)) > 80 {
|
|
if len([]rune(opinion)) > 80 {
|
|
opinion = string([]rune(opinion)[:80]) + "..."
|
|
opinion = string([]rune(opinion)[:80]) + "..."
|
|
}
|
|
}
|
|
- log.Println("极光推送-意见反馈答复", openid, jpushid)
|
|
|
|
|
|
+ log.Println("极光推送-意见反馈答复", sess_openid, jpushid)
|
|
go coreutil.AppPushServiceCall(map[string]interface{}{
|
|
go coreutil.AppPushServiceCall(map[string]interface{}{
|
|
"phoneType": ponetype,
|
|
"phoneType": ponetype,
|
|
"otherPushId": opushid,
|
|
"otherPushId": opushid,
|
|
"jgPushId": jpushid,
|
|
"jgPushId": jpushid,
|
|
"url": msgurl,
|
|
"url": msgurl,
|
|
- "openId": openid,
|
|
|
|
|
|
+ "openId": sess_openid,
|
|
|
|
+ "userId": s_submitid,
|
|
"type": "feedback",
|
|
"type": "feedback",
|
|
"descript": opinion,
|
|
"descript": opinion,
|
|
"extend": map[string]interface{}{
|
|
"extend": map[string]interface{}{
|
|
@@ -234,7 +263,7 @@ func (s *SystemManage) Updateback() error {
|
|
s_detail := "以下是对你提交“" + title + "”意见的回复结果"
|
|
s_detail := "以下是对你提交“" + title + "”意见的回复结果"
|
|
s_remark := " " + opinion
|
|
s_remark := " " + opinion
|
|
go func() {
|
|
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})
|
|
}()
|
|
}()
|
|
}
|
|
}
|
|
}
|
|
}
|