guhongwei 3 anni fa
parent
commit
d55bd25133
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5 3
      app/service/users/personal.js

+ 5 - 3
app/service/users/personal.js

@@ -20,8 +20,11 @@ class PersonalService extends CrudService {
   }
   async query(condition, { skip = 0, limit = 0 }) {
     const query = await this.dealQueryCondition(_.cloneDeep(condition));
-    const res = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit));
-    // .sort({ 'meta.createdAt': -1 });
+    const res = await this.model
+      .find(query)
+      .skip(parseInt(skip))
+      .limit(parseInt(limit))
+      .sort({ 'meta.createdAt': -1 });
     return res;
   }
   async count(condition) {
@@ -43,7 +46,6 @@ class PersonalService extends CrudService {
       // code直接查询用户返回即可
       condition.code = code;
     }
-    condition.sort = '-1';
     return condition;
   }
   /**