|
@@ -0,0 +1,35 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+// 科技企业表
|
|
|
+const EnterpriseSchema = {
|
|
|
+ code: { type: String, required: true, maxLength: 500 }, // 编号
|
|
|
+ dtype: { type: String, required: false, maxLength: 500 }, // 大类别
|
|
|
+ xtype: { type: String, required: false, maxLength: 500 }, // 小类别
|
|
|
+ name: { type: String, required: true, maxLength: 500 }, // 名称
|
|
|
+ pinyin: { type: String, required: false, maxLength: 500 }, // 拼音
|
|
|
+ logo: { type: String, required: false, maxLength: 500 }, // 类别名称
|
|
|
+ license: { type: String, required: false, maxLength: 500 }, // 执照
|
|
|
+ file_path: { type: String, required: false, maxLength: 500 }, // 证照图片
|
|
|
+ contact: { type: String, required: false, maxLength: 500 }, // 联系方式
|
|
|
+ addr: { type: String, required: false, maxLength: 500 }, // 地址
|
|
|
+ introduction: { type: String, required: false }, // 简介
|
|
|
+ ishomepage: { type: String, required: false, maxLength: 500 }, // 是否显示,0-否,1-是
|
|
|
+ homepage: { type: String, required: false, maxLength: 500 }, // 主页地址
|
|
|
+ longitude: { type: String, required: false, maxLength: 500 }, // 经度
|
|
|
+ latitude: { type: String, required: false, maxLength: 500 }, // 纬度
|
|
|
+ map_info: { type: String, required: false }, // 地图信息
|
|
|
+ state: { type: String, required: false, maxLength: 500 }, // 状态0、未审1、已审2、拒绝
|
|
|
+ is_del: { type: String, required: false, maxLength: 500 }, // 是否删除
|
|
|
+ sort: { type: String, required: false, maxLength: 500 }, // 排序
|
|
|
+};
|
|
|
+
|
|
|
+const schema = new Schema(EnterpriseSchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Enterprise', schema, 'market_enterprise');
|
|
|
+};
|