lrf402788946 3 years ago
parent
commit
6e3418eaf3

+ 2 - 0
app/controller/patent/.purchase.js

@@ -45,6 +45,8 @@ module.exports = {
         type: "type",
         type: "type",
         purchase_type: "purchase_type",
         purchase_type: "purchase_type",
         contacts: "contacts",
         contacts: "contacts",
+        "money@start": "money@start",
+        "money@end": "money@end",
       },
       },
       // options: {
       // options: {
       //   "meta.state": 0 // 默认条件
       //   "meta.state": 0 // 默认条件

+ 1 - 0
app/model/patent/purchase.js

@@ -23,6 +23,7 @@ schema.index({ type: 1 });
 schema.index({ purchase_type: 1 });
 schema.index({ purchase_type: 1 });
 schema.index({ contacts: 1 });
 schema.index({ contacts: 1 });
 schema.index({ status: 1 });
 schema.index({ status: 1 });
+schema.index({ money: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);
 schema.plugin(metaPlugin);
 module.exports = app => {
 module.exports = app => {

+ 1 - 0
app/service/patent/purchase.js

@@ -27,6 +27,7 @@ class PurchaseService extends CrudService {
   }
   }
 
 
   async resetCode(query) {
   async resetCode(query) {
+    query = this.ctx.service.util.util.dealQuery(query);
     const { code } = query;
     const { code } = query;
     let ids = [];
     let ids = [];
     if (code) {
     if (code) {

+ 0 - 1
app/service/patent/sell.js

@@ -15,7 +15,6 @@ class SellService extends CrudService {
   }
   }
   async query(query, { skip = 0, limit = 0 }) {
   async query(query, { skip = 0, limit = 0 }) {
     query = await this.resetCode(query);
     query = await this.resetCode(query);
-    console.log(query);
     const res = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
     const res = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
       .sort({ 'meta.createdAt': -1 });
       .sort({ 'meta.createdAt': -1 });
     return res;
     return res;