|
@@ -1,23 +1,25 @@
|
|
|
-"use strict";
|
|
|
-const Schema = require("mongoose").Schema;
|
|
|
-const metaPlugin = require("naf-framework-mongoose-free/lib/model/meta-plugin");
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
|
|
|
// 团长申请表
|
|
|
const userleader = {
|
|
|
- user_id: { type: String, required: false, zh: "用户id" }, //
|
|
|
- openid: { type: String, required: false, zh: "openid" }, //
|
|
|
- name: { type: String, required: false, zh: "姓名" }, //
|
|
|
- card: { type: String, required: false, zh: "身份证号" }, //
|
|
|
- phone: { type: String, required: false, zh: "手机号" }, //
|
|
|
- status: { type: String, required: false, default: "0", zh: "状态" }, // 字典表:exam_status
|
|
|
- cause: { type: String, required: false, zh: "审核结果" }, //
|
|
|
+ user_id: { type: String, required: false, zh: '用户id' }, //
|
|
|
+ shop: { type: String, required: false, zh: '店铺id' }, //
|
|
|
+ openid: { type: String, required: false, zh: 'openid' }, //
|
|
|
+ name: { type: String, required: false, zh: '姓名' }, //
|
|
|
+ card: { type: String, required: false, zh: '身份证号' }, //
|
|
|
+ phone: { type: String, required: false, zh: '手机号' }, //
|
|
|
+ status: { type: String, required: false, default: '0', zh: '状态' }, // 字典表:exam_status
|
|
|
+ cause: { type: String, required: false, zh: '审核结果' }, //
|
|
|
};
|
|
|
const schema = new Schema(userleader, {
|
|
|
toJSON: { getters: true, virtuals: true },
|
|
|
});
|
|
|
schema.index({ id: 1 });
|
|
|
-schema.index({ "meta.createdAt": 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.index({ user_id: 1 });
|
|
|
+schema.index({ shop: 1 });
|
|
|
schema.index({ openid: 1 });
|
|
|
schema.index({ name: 1 });
|
|
|
schema.index({ card: 1 });
|
|
@@ -28,5 +30,5 @@ schema.plugin(metaPlugin);
|
|
|
|
|
|
module.exports = (app) => {
|
|
|
const { mongoose } = app;
|
|
|
- return mongoose.model("Userleader", schema, "userleader");
|
|
|
+ return mongoose.model('Userleader', schema, 'userleader');
|
|
|
};
|