bannerModel.js 428 B

123456789101112131415
  1. 'use strict';
  2. module.exports = app => {
  3. const mongoose = app.mongoose;
  4. const Schema = mongoose.Schema;
  5. const bannerSchema = new Schema({
  6. imgPath: { type: String }, // 图片路径
  7. order: { type: Number }, // 排序
  8. type: { type: String, default: '0' }, // 默认为0:小程序端banner
  9. createTime: { type: Date, default: Date.now },
  10. });
  11. return mongoose.model('Banner', bannerSchema, 'banner');
  12. };