Bladeren bron

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

wq 4 jaren geleden
bovenliggende
commit
f1c884dad6
2 gewijzigde bestanden met toevoegingen van 15 en 3 verwijderingen
  1. 12 1
      app/service/intelligentDocking.js
  2. 3 2
      app/service/intelligentFollow.js

+ 12 - 1
app/service/intelligentDocking.js

@@ -169,11 +169,12 @@ class IntelligentDockingService extends CrudService {
 
     const total = await this.model.countDocuments(query);
     const result = await this.model.aggregate([
-      { $match: query },
+      //      { $match: query },
       { $project:
           {
             ensure_id: 1,
             person: 1,
+            phone: 1,
             money: 1,
             claims_min_term: 1,
             claims_max_term: 1,
@@ -264,8 +265,18 @@ class IntelligentDockingService extends CrudService {
             finance_claims: '$finance_claims',
             dictionary: '$dictionary',
             follow: '$follow',
+            uuid: { $toObjectId: '$follow.uuid' },
+          },
+      },
+      { $lookup:
+          {
+            from: 'other_user',
+            localField: 'uuid',
+            foreignField: '_id',
+            as: 'otherUser',
           },
       },
+      { $unwind: { path: '$otherUser', preserveNullAndEmptyArrays: true } },
       { $skip: (skip - 1) * limit },
       { $limit: limit },
       { $sort: { time: -1 } },

+ 3 - 2
app/service/intelligentFollow.js

@@ -54,9 +54,10 @@ class IntelligentFollowService extends CrudService {
     }
     if (data.creditStatus) {
       match.creditStatus = data.creditStatus;
-    } else {
-      match.creditStatus = { $ne: '1' };
     }
+    // else {
+    //   match.creditStatus = { $ne: '1' };
+    // }
     const skip = Number.parseInt(data.skip) || 1;
     const limit = Number.parseInt(data.limit) || 10;
     const total = await this.model.countDocuments(match);