活动:修改结构
This commit is contained in:
@@ -24,7 +24,8 @@ export async function getRefreshShopActivity(serverId: number, roleId: string) {
|
||||
return null;
|
||||
}
|
||||
let activityData = activityArray[0];
|
||||
let playerData = new RefreshShopData(activityData);
|
||||
let { createTime } = await RoleModel.findByRoleId(roleId);
|
||||
let playerData = new RefreshShopData(activityData, createTime);
|
||||
|
||||
let playerRecord: ActivityRefreshShopModelType = await ActivityRefreshShopModel.findData(activityData.activityId, roleId, playerData.roundIndex);
|
||||
if (!playerRecord) {//生成商店可购买商品的数据
|
||||
@@ -46,7 +47,8 @@ export async function getRefreshShopActivity(serverId: number, roleId: string) {
|
||||
*/
|
||||
export async function getPlayerRefreshShopData(activityId: number, serverId: number, roleId: string) {
|
||||
let activityData: ActivityModelType = await ActivityModel.findActivity(activityId);
|
||||
let playerData = new RefreshShopData(activityData);
|
||||
let { createTime } = await RoleModel.findByRoleId(roleId);
|
||||
let playerData = new RefreshShopData(activityData, createTime);
|
||||
|
||||
let playerRecord: ActivityRefreshShopModelType = await ActivityRefreshShopModel.findData(activityId, roleId, playerData.roundIndex);
|
||||
if (!playerRecord) {//生成商店可购买商品的数据
|
||||
@@ -68,7 +70,8 @@ export async function getPlayerRefreshShopData(activityId: number, serverId: num
|
||||
*/
|
||||
export async function getPlayerRefreshShopDataByRoundIndex(activityId: number, serverId: number, roleId: string, roundIndex: number) {
|
||||
let activityData: ActivityModelType = await ActivityModel.findActivity(activityId);
|
||||
let playerData = new RefreshShopData(activityData);
|
||||
let { createTime } = await RoleModel.findByRoleId(roleId);
|
||||
let playerData = new RefreshShopData(activityData, createTime);
|
||||
playerData.roundIndex = roundIndex;
|
||||
let playerRecord: ActivityRefreshShopModelType = await ActivityRefreshShopModel.findData(activityId, roleId, playerData.roundIndex);
|
||||
if (!playerRecord) {//生成商店可购买商品的数据
|
||||
@@ -117,7 +120,8 @@ export async function makeRefreshShopReward(roleId: string, roleName: string, si
|
||||
if (activityData.type !== ACTIVITY_TYPE.REFRESH_SHOP) {
|
||||
return STATUS.ACTIVITY_TYPE_ERROR;
|
||||
}
|
||||
let playerData = new RefreshShopData(activityData);
|
||||
let { createTime } = await RoleModel.findByRoleId(roleId);
|
||||
let playerData = new RefreshShopData(activityData, createTime);
|
||||
if (roundIndex) {
|
||||
playerData.roundIndex = roundIndex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user