|
@@ -7,7 +7,7 @@ class UserService extends Service {
|
|
|
super(ctx);
|
|
|
this.model = this.ctx.model.User;
|
|
|
}
|
|
|
- async create({ name, thumbnail, phone, stcompanyatus, tab, openid }) {
|
|
|
+ async create({ name, thumbnail, phone, company, tab, openid }) {
|
|
|
assert(name, '昵称不存在');
|
|
|
assert(phone, '电话不存在');
|
|
|
assert(openid, 'openid不存在');
|
|
@@ -25,16 +25,16 @@ class UserService extends Service {
|
|
|
return { errcode: -1001, errmsg: '手机号或微信已存在' };
|
|
|
}
|
|
|
try {
|
|
|
- const res = await this.model.create({ name, thumbnail, phone, stcompanyatus, tab, openid });
|
|
|
+ const res = await this.model.create({ name, thumbnail, phone, company, tab, openid });
|
|
|
return { errcode: 0, errmsg: 'ok', data: res };
|
|
|
} catch (error) {
|
|
|
throw error;
|
|
|
}
|
|
|
}
|
|
|
- async update({ id, name, thumbnail, phone, stcompanyatus, tab, openid }) {
|
|
|
+ async update({ id, name, thumbnail, phone, company, tab, openid }) {
|
|
|
assert(id, 'id不存在');
|
|
|
try {
|
|
|
- await this.model.updateOne({ _id: id }, { name, thumbnail, phone, stcompanyatus, tab, openid });
|
|
|
+ await this.model.updateOne({ _id: id }, { name, thumbnail, phone, company, tab, openid });
|
|
|
return { errcode: 0, errmsg: 'ok', data: '' };
|
|
|
} catch (error) {
|
|
|
throw error;
|
|
@@ -49,9 +49,9 @@ class UserService extends Service {
|
|
|
throw error;
|
|
|
}
|
|
|
}
|
|
|
- async query({ skip, limit, name, phone, stcompanyatus, tab, openid }) {
|
|
|
+ async query({ skip, limit, name, phone, company, tab, openid }) {
|
|
|
const filter = {};
|
|
|
- const arr = { name, phone, stcompanyatus, tab, openid };
|
|
|
+ const arr = { name, phone, company, tab, openid };
|
|
|
for (const e in arr) {
|
|
|
const data = `{ "${e}": { "$regex": "${arr[e]}" } }`;
|
|
|
if (arr[e]) {
|