|
@@ -431,11 +431,11 @@ func MultSave(this message.MultipleSaveMsgReq) (int64, string) {
|
|
|
}()
|
|
|
//消息数组
|
|
|
nTime := time.Now().Format("2006-01-02 15:04:05")
|
|
|
- c := entity.Mysql.Count("conversation", map[string]interface{}{"receive_id": v, "send_id": this.SendUserId})
|
|
|
+ //c := entity.Mysql.Count("conversation", map[string]interface{}{"receive_id": v, "send_id": this.SendUserId})
|
|
|
sql3 := `INSERT INTO message(appid,receive_userid,receive_name,send_userid,send_name,title,content,msg_type,link,cite_id,createtime,isRead,isdel,msg_log_id,show_buoy,show_content,group_id,position_id) values ("%s",'%s','%s','%s','%s','%s','%s',%d,'%s',0,'%s',0,1,%d,%d,'%s',%d,?);`
|
|
|
sql3 = fmt.Sprintf(sql3, this.Appid, v, userName, this.SendUserId, this.SendName, this.Title, this.Content, this.MsgType, this.Link, nTime, this.MsgLogId, this.ShowBuoy, this.ShowContent, group_id)
|
|
|
var in int64
|
|
|
- if c <= 0 {
|
|
|
+ /*if c <= 0 {
|
|
|
sql1 := `INSERT INTO conversation(appid,secret_key,user_id,receive_id,receive_name,send_id,send_name,sort,createtime) values ('%s','','%s','%s','%s','%s','%s',0,'%s');`
|
|
|
sql1 = fmt.Sprintf(sql1, this.Appid, this.SendUserId, v, userName, this.SendUserId, this.SendName, nTime)
|
|
|
|
|
@@ -454,16 +454,16 @@ func MultSave(this message.MultipleSaveMsgReq) (int64, string) {
|
|
|
log.Println("存redis:", ok1, v)
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- in = entity.Mysql.InsertBySql(sql3, common.If(positionId != 0, positionId, nil))
|
|
|
- logx.Info("插入消息返回 in1 id:", in)
|
|
|
- if in > -1 {
|
|
|
- ok := MsgCountAdd(v, this.Appid, util.Int64All(group_id))
|
|
|
- if !ok {
|
|
|
- log.Println("存redis:", ok, v)
|
|
|
- }
|
|
|
+ } else {*/
|
|
|
+ in = entity.Mysql.InsertBySql(sql3, common.If(positionId != 0, positionId, nil))
|
|
|
+ logx.Info("插入消息返回 in1 id:", in)
|
|
|
+ if in > -1 {
|
|
|
+ ok := MsgCountAdd(v, this.Appid, util.Int64All(group_id))
|
|
|
+ if !ok {
|
|
|
+ log.Println("存redis:", ok, v)
|
|
|
}
|
|
|
}
|
|
|
+ //}
|
|
|
if in > -1 {
|
|
|
//发送消息成功,推送微信、app
|
|
|
pushConfig, err := GetWxTmplConfig(this.MsgType)
|