活动:月卡到第二个月天数会显示错误
This commit is contained in:
@@ -33,7 +33,7 @@ export default class Activity_Monthly_Ticket extends BaseModel {
|
||||
|
||||
//查询月卡详情
|
||||
public static async findMonthlyTicket(serverId: number, roleId: string, activityId: number) {
|
||||
let result: ActivityMonthlyTicketModelType = await ActivityMonthlyTicketModel.findOne({ serverId, roleId, activityId }).lean(true);
|
||||
let result: ActivityMonthlyTicketModelType = await ActivityMonthlyTicketModel.findOne({ serverId, roleId, activityId }).sort({ endTime: -1 }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ export class MonthlyTicketData extends ActivityBase {
|
||||
if (data.isForever || moment(new Date).valueOf() < this.cardEndTime) {
|
||||
this.isOpen = true;
|
||||
this.todayIndex = deltaDays(moment(data.createdAt).startOf('d').add(REFRESH_TIME, 'h').toDate(), new Date) + 1;
|
||||
this.days = deltaDays(moment(data.createdAt).startOf('d').add(REFRESH_TIME, 'h').toDate(), new Date(this.cardEndTime));
|
||||
} else {
|
||||
this.todayIndex = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user