guhongwei 3 سال پیش
والد
کامیت
d3e4fb71bf
2فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 3 0
      app/controller/patent/.patenttrans.js
  2. 2 0
      app/model/patent/patenttrans.js

+ 3 - 0
app/controller/patent/.patenttrans.js

@@ -2,6 +2,7 @@ module.exports = {
   create: {
     requestBody: [
       "user_id",
+      "admin_id",
       "patent_id",
       "create_number",
       "patent_name",
@@ -30,6 +31,7 @@ module.exports = {
     params: ["!id"],
     requestBody: [
       "user_id",
+      "admin_id",
       "patent_id",
       "create_number",
       "patent_name",
@@ -61,6 +63,7 @@ module.exports = {
     parameters: {
       query: {
         user_id: "user_id",
+        admin_id:"admin_id",
         patent_id: "patent_id",
         create_number: "create_number",
         patent_name: "patent_name",

+ 2 - 0
app/model/patent/patenttrans.js

@@ -6,6 +6,7 @@ const { ObjectId } = require('mongoose').Types;
 // 专利交易表
 const patenttrans = {
   user_id: { type: ObjectId },
+  admin_id: { type: ObjectId },
   patent_id: { type: ObjectId }, // 专利id
   create_number: { type: String }, // 专利号
   patent_name: { type: String }, // 专利名
@@ -31,6 +32,7 @@ const patenttrans = {
 const schema = new Schema(patenttrans, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ user_id: 1 });
+schema.index({ admin_id: 1 });
 schema.index({ patent_id: 1 });
 schema.index({ create_number: 1 });
 schema.index({ patent_name: 1 });