|
@@ -3,6 +3,7 @@ const { CrudService } = require('naf-framework-mongoose/lib/service');
|
|
|
const { BusinessError, ErrorCode } = require('naf-core').Error;
|
|
|
const _ = require('lodash');
|
|
|
const jwt = require('jsonwebtoken');
|
|
|
+const assert = require('assert');
|
|
|
// 机构
|
|
|
class OrganizationService extends CrudService {
|
|
|
constructor(ctx) {
|
|
@@ -66,8 +67,9 @@ class OrganizationService extends CrudService {
|
|
|
* @param {Object} query phone:电话号
|
|
|
* @param {Object} options skip;limit
|
|
|
*/
|
|
|
- async getList({ phone }, { skip = 0, limit = 0 } = {}) {
|
|
|
- const list = await this.model.find({ phone }).skip(parseInt(skip)).limit(parseInt(limit));
|
|
|
+ async getList({ name, phone }, { skip = 0, limit = 0 } = {}) {
|
|
|
+ assert(phone, '缺少手机号');
|
|
|
+ const list = await this.model.find({ phone, name }).skip(parseInt(skip)).limit(parseInt(limit));
|
|
|
return list;
|
|
|
}
|
|
|
|