|
@@ -15,7 +15,7 @@ const card = {
|
|
|
name: { type: String, required: true }, // 姓名
|
|
|
id_card: { type: String, required: true, lowercase: true }, // 身份证
|
|
|
level: { type: Number, required: true, default: 1 }, // 等级
|
|
|
- points: { type: Number, default: 600 }, // 积分
|
|
|
+ points: { type: Number, default: 0 }, // 积分
|
|
|
recommend: { type: String }, // 推荐人
|
|
|
r_mobile: { type: String }, // 推荐人电话
|
|
|
car_show: { type: Boolean, default: false }, // 车奖
|
|
@@ -25,9 +25,13 @@ const card = {
|
|
|
type: String,
|
|
|
default: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
}, // 创建/办卡 时间
|
|
|
+ status: { type: String, default: '1' }, // 审核状态:0=>可以使用;1=>禁止使用,需要审核
|
|
|
+ admin: { type: Boolean, default: false },
|
|
|
};
|
|
|
const schema = new Schema(card, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
+schema.index({ status: 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.plugin(metaPlugin);
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|