Jelajahi Sumber

增加企业员工姓名

wangchuanjin 2 tahun lalu
induk
melakukan
45bab84af6
1 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 6 2
      src/jfw/front/websocket.go

+ 6 - 2
src/jfw/front/websocket.go

@@ -351,15 +351,19 @@ func GetBuoyMsg(conn *websocket.Conn) {
 	}()
 	}()
 	//发送消息
 	//发送消息
 	for {
 	for {
+		if err := websocket.Message.Send(conn, "HeartBeat"); err != nil {
+			conn.Close()
+			return
+		}
 		timeA := time.Now().AddDate(0, 0, -qutil.IntAllDef(messageCenter["limitDay"], 7))
 		timeA := time.Now().AddDate(0, 0, -qutil.IntAllDef(messageCenter["limitDay"], 7))
 		timeB, err := time.ParseInLocation(qutil.Date_Full_Layout, createtime, time.Local)
 		timeB, err := time.ParseInLocation(qutil.Date_Full_Layout, createtime, time.Local)
 		if err == nil && timeA.After(timeB) {
 		if err == nil && timeA.After(timeB) {
 			createtime = qutil.FormatDate(&timeA, qutil.Date_Full_Layout)
 			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 {
 		if list != nil {
 			for _, v := range *list {
 			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
 					continue
 				}
 				}
 				id := qutil.Int64All(v["id"])
 				id := qutil.Int64All(v["id"])