lrf402788946 3 years ago
parent
commit
6a50032bdf
2 changed files with 5 additions and 0 deletions
  1. 3 0
      app/controller/patent/.sell.js
  2. 2 0
      app/model/patent/sell.js

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

@@ -2,6 +2,7 @@ module.exports = {
   create: {
     requestBody: [
       "create_number",
+      "patent_id",
       "name",
       "inventor",
       "type",
@@ -22,6 +23,7 @@ module.exports = {
     params: ["!id"],
     requestBody: [
       "create_number",
+      "patent_id",
       "name",
       "inventor",
       "type",
@@ -44,6 +46,7 @@ module.exports = {
     parameters: {
       query: {
         code: "code",
+        patent_id: "patent_id",
         user_id: "user_id",
         status: "status",
         create_number: "create_number",

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

@@ -6,6 +6,7 @@ const { ObjectId } = require('mongoose').Types;
 // 发布交易表
 const sell = {
   user_id: { type: ObjectId }, // 用户id
+  patent_id: { type: ObjectId }, // 专利id
   create_number: { type: String }, // 申请号
   name: { type: String }, // 专利名称
   inventor: { type: String }, // 权利人
@@ -21,6 +22,7 @@ const sell = {
 const schema = new Schema(sell, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ user_id: 1 });
+schema.index({ patent_id: 1 });
 schema.index({ create_number: 1 });
 schema.index({ name: 1 });
 schema.index({ type: 1 });