This commit is contained in:
mamengke01
2021-02-06 17:41:58 +08:00
parent f4c54d71f7
commit 6b518ab36f

View File

@@ -117,15 +117,19 @@ export async function sendRolesMails(mails) {
let pushMessage: pushMail[] = [];
for (let { gmMailType, id: mailId, sendRoles, endTime, content, goods, sendTime, sendName } of mails) {
let uids = [];
if (endTime < nowSeconds()|| sendTime > nowSeconds())
continue;
if (gmMailType != GM_MAIL_TYPE.GROUPMAIL)
return;
let mail = await GroupMailModel.getMail(mailId, MAIL_TEM_TYPE.GMTYPE);
if (!mail) {
const doc = new GroupMailModel();
const mail = Object.assign(doc.toJSON(), { mailId, mailTemType: MAIL_TEM_TYPE.GMTYPE, sendRoles, sendName });
mail = Object.assign(doc.toJSON(), { mailId, mailTemType: MAIL_TEM_TYPE.GMTYPE, sendRoles, sendName });
addGroupMails.push(mail);
} else {
return;
}
for (let {roleId} of sendRoles) {
for (let { roleId } of sendRoles) {
let key = 'login_roleId_' + roleId;
let sid = await getRedis(key);
if (!!sid) {