移除 setLocalHours

This commit is contained in:
luying
2021-01-12 20:23:25 +08:00
parent 94ce1fc5dc
commit 08d31ffb8d
4 changed files with 10 additions and 18 deletions

View File

@@ -1,7 +1,6 @@
import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
import { DAILY_CONST } from './../consts';
import { setLocalHours } from './../pubUtils/util';
/**
@@ -30,7 +29,7 @@ export default class DailyRecord extends BaseModel {
const dailyRecord: DailyRecordType = await DailyRecordModel.findOne({ roleId, type }).lean(lean);
let {count = 0, refTime = 0, buyCount = 0} = dailyRecord||{};
let now = new Date();
let today = setLocalHours(DAILY_CONST.REFRESH_TIME, now);
let today = now.setHours(DAILY_CONST.REFRESH_TIME, 0, 0, 0);
if(today > refTime) {
refTime = today; count = 0; buyCount = 0;