Quellcode durchsuchen

更换监听预警信息条件,失效日-申请日

guhongwei vor 3 Jahren
Ursprung
Commit
bf513149a4
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      app/service/patent/patentearly.js

+ 4 - 4
app/service/patent/patentearly.js

@@ -75,13 +75,13 @@ class PatentearlyService extends CrudService {
 
   async searchAndDeal(skip, limit) {
     let total = 0;
-    let data = await this.patentinfo.find({ term: '有效' }, { name: 1, inventor: 1, lose_date: 1, user_id: 1 }).skip(skip).limit(limit);
+    let data = await this.patentinfo.find({ term: '有效' }, { name: 1, inventor: 1, create_date: 1, user_id: 1 }).skip(skip).limit(limit);
     if (data.length > 0) data = JSON.parse(JSON.stringify(data));
     // 取出今天是不是在失效时间的前1个月范围内
     for (const i of data) {
-      const { lose_date } = i;
-      const start = moment(lose_date).subtract(1, 'M');
-      const end = moment(lose_date).add(3, 'M');
+      const { create_date } = i;
+      const start = moment(create_date).subtract(1, 'M');
+      const end = moment(create_date).add(3, 'M');
       const r = moment().isBetween(start, end, null, '[]');
       if (r) {
         total++;