|
@@ -0,0 +1,40 @@
|
|
|
|
+'use strict';
|
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
|
+
|
|
|
|
+// 企业调查
|
|
|
|
+const investigation = {
|
|
|
|
+ name: { type: String, required: true }, // 企业名称
|
|
|
|
+ address: { type: String, required: false }, // 通讯地址
|
|
|
|
+ postal: { type: String, required: false }, // 邮编
|
|
|
|
+ field: { type: Array, required: false }, // 所属领域
|
|
|
|
+ funds: { type: String, required: false }, // 注册资金
|
|
|
|
+ register_time: { type: String, required: false }, // 注册时间
|
|
|
|
+ web_site: { type: String, required: false }, // 网址
|
|
|
|
+ legal_person: { type: Object, required: false }, // 法人信息
|
|
|
|
+ register_type: { type: Array, required: false }, // 注册登记类型
|
|
|
|
+ contact: { type: String, required: false }, // 联系人
|
|
|
|
+ contact_tel: { type: String, required: false }, // 联系电话
|
|
|
|
+ email: { type: String, required: false }, // 电子邮箱
|
|
|
|
+ person_number: { type: String, required: false }, // 职工人数
|
|
|
|
+ bk_number: { type: String, required: false }, // 本科以上人数
|
|
|
|
+ research_number: { type: String, required: false }, // 研究开发人数
|
|
|
|
+ advanced_number: { type: String, required: false }, // 高级职称人数
|
|
|
|
+ brief: { type: String, required: false }, // 企业概况
|
|
|
|
+ products: { type: Array, required: false }, // 产品列表
|
|
|
|
+ requirement: { type: Object, required: false }, // 企业需求情况
|
|
|
|
+};
|
|
|
|
+const schema = new Schema(investigation, { toJSON: { virtuals: true } });
|
|
|
|
+schema.index({ id: 1 });
|
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
|
+schema.index({ name: 1 });
|
|
|
|
+schema.index({ field: 1 });
|
|
|
|
+schema.index({ register_time: 1 });
|
|
|
|
+schema.index({ register_type: 1 });
|
|
|
|
+schema.index({ contact_tel: 1 });
|
|
|
|
+
|
|
|
|
+schema.plugin(metaPlugin);
|
|
|
|
+module.exports = app => {
|
|
|
|
+ const { mongoose } = app;
|
|
|
|
+ return mongoose.model('Investigation', schema, 'investigation');
|
|
|
|
+};
|