lrf 2 years ago
parent
commit
b26bde1256
3 changed files with 2 additions and 20 deletions
  1. 1 0
      app/controller/config/.bill.js
  2. 1 0
      app/model/race/bill.js
  3. 0 20
      app/service/matchSmallGroupSchedule.js

+ 1 - 0
app/controller/config/.bill.js

@@ -28,6 +28,7 @@ module.exports = {
         payer_id: 'payer_id',
         'time@start': 'time@start',
         'time@end': 'time@end',
+        type: 'type',
       },
       // options: {
       //   "meta.state": 0 // 默认条件

+ 1 - 0
app/model/race/bill.js

@@ -23,6 +23,7 @@ schema.index({ group_id: 1 });
 schema.index({ project_id: 1 });
 schema.index({ pay_id: 1 });
 schema.index({ time: 1 });
+schema.index({ type: 1 });
 
 schema.plugin(metaPlugin);
 schema.plugin(MoneyPlugin({ zh: '金额', required: false }));

+ 0 - 20
app/service/matchSmallGroupSchedule.js

@@ -169,26 +169,6 @@ class MatchSmallGroupScheduleService extends CrudService {
 
     return d;
   }
-
-  // 针对每个表进行检查
-  resetPopulate(schema) {
-    const arr = [];
-    for (const key in schema) {
-      const e = schema[key];
-      const { ref, refPath } = e;
-      if (!ref && !refPath) continue;
-      const refValue = ref || refPath;
-      const obj = { path: key };
-      const modelPath = this.formatModelPath(refValue);
-      const model = this.getModel(modelPath);
-      obj.model = model;
-      const msch = this.getSchema(modelPath);
-      const popu = this.resetPopulate(msch);
-      if (popu.length > 0) obj.populate = popu;
-      arr.push(obj);
-    }
-    return arr;
-  }
 }
 
 module.exports = MatchSmallGroupScheduleService;