|
@@ -0,0 +1,32 @@
|
|
|
+'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 policy = {
|
|
|
+ user_id: { type: ObjectId },
|
|
|
+ type: { type: String }, // 研发补贴,奖励兑现
|
|
|
+ company: { type: String }, // 申请单位
|
|
|
+ apply_personal: { type: String }, // 申请人
|
|
|
+ phone: { type: String }, // 联系电话
|
|
|
+ qyfr: { type: Array }, // 法人复印件
|
|
|
+ yyzz: { type: Array }, // 企业营业执照
|
|
|
+ qylr: { type: Array }, // 企业利润表
|
|
|
+ desc: { type: String }, // 建议
|
|
|
+ status: { type: String, default: '0' }, // 0:申请;1:通过;2拒绝
|
|
|
+
|
|
|
+ remark: { type: String },
|
|
|
+ create_time: { type: String, default: moment(new Date()).format('YYYY-MM-DD HH:mm:ss') },
|
|
|
+};
|
|
|
+const schema = new Schema(policy, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ type: 1 });
|
|
|
+schema.index({ company: 1 });
|
|
|
+schema.index({ phone: 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Policy', schema, 'policy');
|
|
|
+};
|