|
@@ -4,7 +4,7 @@ const moment = require('moment');
|
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
const { ObjectId } = require('mongoose').Types;
|
|
|
// 专利交易表
|
|
|
-const patent_trans = {
|
|
|
+const patenttrans = {
|
|
|
user_id: { type: ObjectId },
|
|
|
patent_id: { type: ObjectId }, // 专利id
|
|
|
patent_name: { type: String }, // 专利名
|
|
@@ -19,7 +19,7 @@ const patent_trans = {
|
|
|
condition: { type: String }, // 合作条件及要求
|
|
|
status: { type: String }, // 状态 0:未交易 1:已交易
|
|
|
};
|
|
|
-const schema = new Schema(patent_trans, { toJSON: { virtuals: true } });
|
|
|
+const schema = new Schema(patenttrans, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
schema.index({ patent_id: 1 });
|
|
|
schema.index({ patent_name: 1 });
|
|
@@ -33,5 +33,5 @@ schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.plugin(metaPlugin);
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|
|
|
- return mongoose.model('Patent_trans', schema, 'patent_trans');
|
|
|
+ return mongoose.model('Patenttrans', schema, 'patent_trans');
|
|
|
};
|