lrf402788946 4 years ago
parent
commit
b0600e8f15
2 changed files with 10 additions and 6 deletions
  1. 6 5
      app/controller/patent/.disclosure.js
  2. 4 1
      app/service/patent/disclosure.js

+ 6 - 5
app/controller/patent/.disclosure.js

@@ -16,7 +16,7 @@ module.exports = {
       "is_mech",
       "mechanism_id",
       "mechanism_name",
-      'status'
+      "status",
     ],
   },
   destroy: {
@@ -41,7 +41,7 @@ module.exports = {
       "is_mech",
       "mechanism_id",
       "mechanism_name",
-      'status'
+      "status",
     ],
   },
   show: {
@@ -61,12 +61,13 @@ module.exports = {
         is_mech: "is_mech",
         mechanism_id: "mechanism_id",
         mechanism_name: "mechanism_name",
+        type: "type",
         "create_time@start": "create_time@start",
         "create_time@end": "create_time@end",
       },
-      // options: {
-      //   "meta.state": 0 // 默认条件
-      // },
+      options: {
+        "meta.state": 0 // 默认条件
+      },
     },
     service: "query",
     options: {

+ 4 - 1
app/service/patent/disclosure.js

@@ -13,6 +13,7 @@ class DisclosureService extends CrudService {
     this.model = this.ctx.model.Patent.Disclosure;
   }
 
+
   /**
    * 交底书审核
    * @param {body} body 参数
@@ -21,7 +22,9 @@ class DisclosureService extends CrudService {
    * @property info 其他数据,当做多个备注,记录使用
    */
   async check({ id, status, remark }) {
-    await this.model.updateOne({ _id: ObjectId(id) }, { status });
+    const data = { status };
+    if (status === '4') data['meta.status'] = '1';
+    await this.model.updateOne({ _id: ObjectId(id) }, data);
     // 换成对应的状态码,record在下面
     return await this.record({ id, method: status, remark });
   }