1234567891011121314151617181920 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const moment = require('moment');
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { ObjectId } = require('mongoose').Types;
- // 评估报告表
- const report = {
- disclosure_id: { type: ObjectId }, // 申请id
- content: { type: String }, // 内容
- remark: { type: String },
- };
- const schema = new Schema(report, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ disclosure_id: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('DisclosureReport', schema, 'disclosure_report');
- };
|