Commit 870f8f53 by chenjinjing

no message

parent 856a29a8
......@@ -216,23 +216,32 @@ export async function delMessage({msgId}) {
* @returns
*/
export async function noticeMessage({userId}) {
let selectParam:any = {"$or":[{ lableId:{"$in":CLIENTMSGLABLE.所有人} }]};
/**非游客用户通知消息条件 */
let userInfo = await findOnce(TABLEENUM.用户表, {userId}, ["lableId", "memberType", "rejectRemarks"]);
let userInfo = await findOnce(TABLEENUM.用户表, {userId}, ["lableId", "memberType", "memberLever", "rejectRemarks"]);
if (!userInfo) throw new BizError(ERRORENUM.目标数据不存在);
// if (!userInfo || !userInfo.lableId) return successErrorResult("该会员暂无消息通知标签分类");
let nowDate = new Date().valueOf();
let memberType = userInfo.memberType.toString();
selectParam["$or"].push(
{ lableId:{"$in":memberType} },
let selectParam:any = {
"$or":[{ lableId:{"$in":CLIENTMSGLABLE.所有人} }],
effectiveTime:{"$gt":nowDate} //有效时间大于当前时间的消息发送通知
};
let memberType = changeEnumValue(MEMBERTYPE, userInfo.memberType);
let memberLever = changeEnumValue(MEMBERLEVEL, userInfo.memberLever);
selectParam["$or"].push(
{
lableId:{"$in":memberType}
},
{
lableId:{"$in":memberLever}
},
{
lableId:{"$in":userInfo.lableId},
effectiveTime:{"$gt":nowDate} //有效时间大于当前时间的消息发送通知
// effectiveTime:{"$gt":nowDate} //有效时间大于当前时间的消息发送通知
}
)
let dataList = [];
const SelectFiles = ["msgId", "msgTitle", "effectiveTime", "msgContent", "isPop", "lableId"];
let msgInfo = await findToSort(TABLEENUM.消息通知表, selectParam, {createTime:-1}, SelectFiles);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment