时间:整理时间方法

This commit is contained in:
luying
2021-05-08 19:13:44 +08:00
parent 6f03a96c51
commit 78e3c26a7a
51 changed files with 662 additions and 411 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType, modelOptions } from '@typegoose/typegoose';
import { genCode } from '../pubUtils/util';
import { getCurWeekDate, getCurMonthDate, getTodayZeroDate } from '../pubUtils/timeUtil';
import { getZeroPointD } from '../pubUtils/timeUtil';
import { SHOP_REFRESH_TYPE } from '../consts';
import { DicShop } from '../pubUtils/dictionary/DicShop';
@@ -37,9 +37,9 @@ export default class UserShop extends BaseModel {
count: number; // 数量
private static getRefreshCondition() {
let today = getTodayZeroDate(5);
let cutWeek = getCurWeekDate(1, 5);
let curMonth = getCurMonthDate(1, 5);
let today = getZeroPointD();
let cutWeek = getZeroPointD(SHOP_REFRESH_TYPE.WEEKLY);
let curMonth = getZeroPointD(SHOP_REFRESH_TYPE.MONTHLY);
return [
{ createdAt: { $gte: today }, refreshType: SHOP_REFRESH_TYPE.DAILY },