|
@@ -351,15 +351,19 @@ func GetBuoyMsg(conn *websocket.Conn) {
|
|
|
}()
|
|
|
//发送消息
|
|
|
for {
|
|
|
+ if err := websocket.Message.Send(conn, "HeartBeat"); err != nil {
|
|
|
+ conn.Close()
|
|
|
+ return
|
|
|
+ }
|
|
|
timeA := time.Now().AddDate(0, 0, -qutil.IntAllDef(messageCenter["limitDay"], 7))
|
|
|
timeB, err := time.ParseInLocation(qutil.Date_Full_Layout, createtime, time.Local)
|
|
|
if err == nil && timeA.After(timeB) {
|
|
|
createtime = qutil.FormatDate(&timeA, qutil.Date_Full_Layout)
|
|
|
}
|
|
|
- list := public.BaseMysql.SelectBySql(`select id,title,link,content,show_content,pc_tip,isRead from `+dbName+`.message where receive_userid=? and isdel=1 and appid=? and createtime>? order by createtime desc limit ?`, userid, appid, createtime, limitCount)
|
|
|
+ list := public.BaseMysql.SelectBySql(`select id,title,link,content,show_content,pc_tip,isdel,isRead from `+dbName+`.message where receive_userid=? and appid=? and createtime>? order by createtime desc limit ?`, userid, appid, createtime, limitCount)
|
|
|
if list != nil {
|
|
|
for _, v := range *list {
|
|
|
- if qutil.IntAll(v["pc_tip"]) == 1 || qutil.IntAll(v["isRead"]) == 1 {
|
|
|
+ if qutil.IntAll(v["pc_tip"]) == 1 || qutil.IntAll(v["isdel"]) != 1 || qutil.IntAll(v["isRead"]) == 1 {
|
|
|
continue
|
|
|
}
|
|
|
id := qutil.Int64All(v["id"])
|