...
|
...
|
@@ -155,7 +155,7 @@ func GetUserMsgs(userId, companyId int64, msgType int, sourceType int, lastId in |
|
|
|
|
|
//获取公告消息列表
|
|
|
func GetUserMsgsBulletin(userId, companyId int64, msgType int, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
|
|
sql := `select b.id,b.title,unix_timestamp(b.update_at)*1000 update_at,a.is_read `
|
|
|
sql := `select a.id msg_id,b.id,b.title,unix_timestamp(a.create_at)*1000 update_at,a.is_read `
|
|
|
sqlCount := `select count(0) `
|
|
|
where := `from user_msg a,bulletin b where a.receive_user_id =? and a.company_id=? and a.source_id = b.id and a.msg_type=? and a.company_id=? and b.status=2 `
|
|
|
sqlCount += where
|
...
|
...
|
@@ -168,7 +168,7 @@ func GetUserMsgsBulletin(userId, companyId int64, msgType int, lastId int64, pag |
|
|
if v == nil {
|
|
|
return
|
|
|
}
|
|
|
where += ` order by b.update_at desc`
|
|
|
where += ` order by a.create_at desc`
|
|
|
sql += where + " limit ?"
|
|
|
if err = utils.ExecuteQueryAll(v, sql, userId, companyId, msgType, companyId, pageSize); err != nil {
|
|
|
return
|
...
|
...
|
|