|
@@ -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++;
|