|
@@ -12,6 +12,7 @@ class UserService extends CrudService {
|
|
|
super(ctx, 'user');
|
|
|
this.model = this.ctx.model.User;
|
|
|
this.rmodel = this.ctx.model.Role;
|
|
|
+ this.productmodel = this.ctx.app.config.axios.product;
|
|
|
}
|
|
|
|
|
|
// 重写创建方法
|
|
@@ -182,8 +183,7 @@ class UserService extends CrudService {
|
|
|
async delete({ id }) {
|
|
|
const res = await this.model.update({ _id: ObjectId(id) }, { isdel: '1' });
|
|
|
if (res) {
|
|
|
- const url = this.ctx.app.config.axios.product;
|
|
|
- const arr = await url.model.updateMany({ userid: ObjectId(id) }, { isdel: '1' });
|
|
|
+ const arr = await this.productmodel.updateMany({ userid: ObjectId(id) }, { isdel: '1' });
|
|
|
if (arr) {
|
|
|
return arr;
|
|
|
}
|