'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { // 用户名(帐号) openid: { type: String, required: false }, // 姓名 name: { type: String, required: false }, // 积分 integral: { type: Number, required: false }, // 创建时间 createTime: { type: String, required: false }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('integralLog', schema, 'integralLog'); };