🐞 fix(活动): 关注豪礼在玩家不是37账号时的逻辑
This commit is contained in:
@@ -40,11 +40,12 @@ export async function getAllSnsLinkData(activityId: number, roleId: string, serv
|
||||
}
|
||||
if(playerData.wxPublicAccount) {
|
||||
if(!user) user = await UserModel.findUserByUid(uid);
|
||||
if(!user.channelInfo) return null;
|
||||
let giftCode = encodeGiftCode(roleId, serverId, user.channelInfo.uid, user.channelInfo.platformAppid, user.channelInfo.childGameId, activityId);
|
||||
playerData.wxPublicAccount.setEncodeGiftCode(giftCode);
|
||||
let playerRecord = await ActivityPublicAccountCodeModel.findByChannel(activityId, user.channelId);
|
||||
if(playerRecord) playerData.wxPublicAccount.setPlayerRecord(playerRecord);
|
||||
if(user.channelInfo) {
|
||||
let giftCode = encodeGiftCode(roleId, serverId, user.channelInfo.uid, user.channelInfo.platformAppid, user.channelInfo.childGameId, activityId);
|
||||
playerData.wxPublicAccount.setEncodeGiftCode(giftCode);
|
||||
let playerRecord = await ActivityPublicAccountCodeModel.findByChannel(activityId, user.channelId);
|
||||
if(playerRecord) playerData.wxPublicAccount.setPlayerRecord(playerRecord);
|
||||
}
|
||||
}
|
||||
|
||||
return playerData;
|
||||
@@ -101,11 +102,12 @@ export async function getPublicAccountData(activityId: number, roleId: string, s
|
||||
playerData.setLinks(links);
|
||||
|
||||
if(playerData.wxPublicAccount) {
|
||||
if(!user.channelInfo) return null;
|
||||
let giftCode = encodeGiftCode(roleId, serverId, user.channelInfo.uid, user.channelInfo.platformAppid, user.channelInfo.childGameId, activityId);
|
||||
playerData.wxPublicAccount.setEncodeGiftCode(giftCode);
|
||||
let playerRecord = await ActivityPublicAccountCodeModel.findByChannel(activityId, user.channelId);
|
||||
if(playerRecord) playerData.wxPublicAccount.setPlayerRecord(playerRecord);
|
||||
if(user.channelInfo) {
|
||||
let giftCode = encodeGiftCode(roleId, serverId, user.channelInfo.uid, user.channelInfo.platformAppid, user.channelInfo.childGameId, activityId);
|
||||
playerData.wxPublicAccount.setEncodeGiftCode(giftCode);
|
||||
let playerRecord = await ActivityPublicAccountCodeModel.findByChannel(activityId, user.channelId);
|
||||
if(playerRecord) playerData.wxPublicAccount.setPlayerRecord(playerRecord);
|
||||
}
|
||||
}
|
||||
|
||||
return playerData;
|
||||
@@ -139,7 +141,7 @@ export async function sendPublicAccountGift(message: string) {
|
||||
if(!isNumber(activityId) || !userCode || !channelId) return;
|
||||
|
||||
let onlineRoleId = await getOnlineRoleByUserCode(userCode);
|
||||
console.log('##### sendPublicAccountGift', message, userCode, onlineRoleId);
|
||||
// console.log('##### sendPublicAccountGift', message, userCode, onlineRoleId);
|
||||
if (!!onlineRoleId) { // 在线,推送消息
|
||||
let playerRecord = await ActivityPublicAccountCodeModel.findByChannel(activityId, channelId);
|
||||
await sendMessageToUserWithSuc(onlineRoleId, PUSH_ROUTE.PUBLIC_ACCOUNT_GIFT, { activityId, type: SNS_LINK_TYPE.WX_PUBLIC_ACCOUNT, status: playerRecord.hasReceived? BIND_PHONE_STATUS.RECEIVED: BIND_PHONE_STATUS.HAS_BIND });
|
||||
|
||||
Reference in New Issue
Block a user