From b28b3638a2f4ff1aae1385af7c702eeb9be1e8c4 Mon Sep 17 00:00:00 2001 From: luying Date: Thu, 6 Apr 2023 15:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=B4=BB=E5=8A=A8):=20?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E8=B1=AA=E7=A4=BC=E5=9C=A8=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E4=B8=8D=E6=98=AF37=E8=B4=A6=E5=8F=B7=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/services/activity/bindPhoneService.ts | 24 ++++++++++--------- .../services/activity/weeklyFundService.ts | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/game-server/app/services/activity/bindPhoneService.ts b/game-server/app/services/activity/bindPhoneService.ts index bcd0d50f8..e98ecf96d 100644 --- a/game-server/app/services/activity/bindPhoneService.ts +++ b/game-server/app/services/activity/bindPhoneService.ts @@ -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 }); diff --git a/game-server/app/services/activity/weeklyFundService.ts b/game-server/app/services/activity/weeklyFundService.ts index cd95fc9bc..621f4c7b0 100644 --- a/game-server/app/services/activity/weeklyFundService.ts +++ b/game-server/app/services/activity/weeklyFundService.ts @@ -34,7 +34,7 @@ export async function getWeeklyFundData(activityId: number, serverId: number, ro */ export async function getWeeklyFundDataShow(activityId: number, serverId: number, roleId: string) { let playerData = await getWeeklyFundData(activityId, serverId, roleId); - console.log('##### weeklyFund', playerData) + // console.log('##### weeklyFund', playerData) if(playerData && playerData.canShow && playerData.canShow()) { return playerData.getShowResult(); }