'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 kjzl_chat = { medium_id: { type: ObjectId }, // 机构id openid: { type: String }, // 用户id project: { type: Object }, // 服务项目 orderid: { type: String }, // 订单id create_time: { type: String }, // 时间 content: { type: String }, // 评价内容 remark: { type: String }, }; const schema = new Schema(kjzl_chat, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ medium_id: 1 }); schema.index({ openid: 1 }); schema.index({ project: 1 }); schema.index({ orderid: 1 }); schema.index({ create_time: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Kjzl_chat', schema, 'kjzl_chat'); };