浏览代码

Merge branch 'master' of http://git.cc-lotus.info/live/service-live

ruifeng_liu 3 年之前
父节点
当前提交
216022c4d0
共有 3 个文件被更改,包括 12 次插入1 次删除
  1. 6 0
      app/controller/patent/.patentapply.js
  2. 4 0
      app/model/patent/patentapply.js
  3. 2 1
      app/service/patent/patentinfo.js

+ 6 - 0
app/controller/patent/.patentapply.js

@@ -6,6 +6,8 @@ module.exports = {
       "is_mech",
       "mechanism_id",
       "mechanism_name",
+      "water_number",
+      "create_number",
       "name",
       "apply_name",
       "type",
@@ -29,6 +31,8 @@ module.exports = {
       "is_mech",
       "mechanism_id",
       "mechanism_name",
+      "water_number",
+      "create_number",
       "name",
       "apply_name",
       "type",
@@ -54,6 +58,8 @@ module.exports = {
         is_mech: "is_mech",
         mechanism_id: "mechanism_id",
         mechanism_name: "mechanism_name",
+        water_number: "water_number",
+        create_number: "create_number",
         name: "name",
         apply_name: "apply_name",
         type: "type",

+ 4 - 0
app/model/patent/patentapply.js

@@ -10,6 +10,8 @@ const patentapply = {
   is_mech: { type: String }, // 是否需要机构
   mechanism_id: { type: ObjectId }, // 机构id
   mechanism_name: { type: String }, // 机构名称
+  water_number: { type: String }, // 流水号
+  create_number: { type: String }, // 申请号
   name: { type: String }, // 发明名称
   apply_name: { type: String }, // 申请人
   type: { type: String }, // 申请类型
@@ -29,6 +31,8 @@ schema.index({ admin_id: 1 });
 schema.index({ is_mech: 1 });
 schema.index({ mechanism_id: 1 });
 schema.index({ mechanism_name: 1 });
+schema.index({ water_number: 1 });
+schema.index({ create_number: 1 });
 schema.index({ name: 1 });
 schema.index({ apply_name: 1 });
 schema.index({ status: 1 });

+ 2 - 1
app/service/patent/patentinfo.js

@@ -66,13 +66,14 @@ class PatentinfoService extends CrudService {
     return query;
   }
 
-  async queryByOrg({ code, status, skip = 0, limit = 0 }) {
+  async queryByOrg({ code, status, term, skip = 0, limit = 0 }) {
     assert(code, '缺少机构信息');
     let pids = await this.personalModel.find({ code }, { _id: 1 });
     if (pids.length <= 0) return { data: [], total: 0 };
     pids = pids.map(i => i._id);
     const query = { user_id: { $elemMatch: { $in: pids } } };
     if (status) query.status = status;
+    if (term) query.term = term;
     const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
       .sort({ 'meta.createdAt': -1 });
     const total = await this.model.count(query);