12345678910111213141516171819202122232425262728293031 |
- 'use strict';
- module.exports = app => {
- const mongoose = app.mongoose;
- const Schema = mongoose.Schema;
- const conn = app.mongooseDB.get('etlLocalDB');
- // 消息中心 本地清洗 数据结构
- const MsgCenterRecordSchema = new Schema({
- create_date: { type: Number }, // 统计的数据是哪一天的
- year: { type: Number }, // 年 统计的数据
- month: { type: Number }, // 月 统计的数据
- day: { type: Number }, // 日 统计的数据
- dateString: { type: String }, // 时间字符串 yyyy-MM-dd
- start_time: { type: Date }, // 开始统计时间
- end_time: { type: Date, default: Date.now }, // 结束统计时间
- total: { type: Number }, // 当日总数
- colorTotal: { type: Number }, // 彩色
- grayTotal: { type: Number }, // 灰色
- readTotal: { type: Number }, // 已读
- unReadTotal: { type: Number }, // 未读
- msgType: [
- {
- _id: { type: Number }, // 类型
- count: { type: Number }, // 总数
- readCount: { type: Number }, // 查看数
- },
- ],
- });
- MsgCenterRecordSchema.index({ create_date: -1 });
- return conn.model('MsgCenterRecord', MsgCenterRecordSchema, 'lc_msg_center_record');
- };
|