Browse Source

修改查询

zs 1 year ago
parent
commit
cc7a1438ef

+ 3 - 1
src/interface/core/opinion.interface.ts

@@ -35,10 +35,12 @@ export class FVO_opinion {
 export class QDTO_opinion extends SearchBase {
   constructor() {
     const like_prop = [];
-    const props = ['userType', 'type', 'status'];
+    const props = ['user', 'userType', 'type', 'status'];
     const mapping = [];
     super({ like_prop, props, mapping });
   }
+  @ApiProperty({ description: '用户id' })
+  'user': string = undefined;
   @ApiProperty({ description: '用户类型' })
   'userType': string = undefined;
   @ApiProperty({ description: '问题类型' })

+ 2 - 2
src/interface/core/teacher.interface.ts

@@ -50,8 +50,8 @@ export class FVO_teacher {
 
 export class QDTO_teacher extends SearchBase {
   constructor() {
-    const like_prop = [];
-    const props = ['openid', 'is_show', 'nick_name', 'gender', 'age', 'phone', 'grade', 'card', 'education', 'college', 'learnStatus', 'brief', 'status'];
+    const like_prop = ['nick_name'];
+    const props = ['openid', 'is_show', 'gender', 'age', 'phone', 'grade', 'card', 'education', 'college', 'learnStatus', 'brief', 'status'];
     const mapping = [];
     super({ like_prop, props, mapping });
   }

+ 5 - 2
src/service/util.service.ts

@@ -22,7 +22,10 @@ export class UtilService {
 
   // 修改后信息后用户重新审核
   async updateUserAfter(id, body, role_type) {
-    const model = GetModel(upperFirst(role_type));
-    await model.updateOne({ _id: id }, { status: '0' });
+    const { is_show, status } = body;
+    if (is_show === '0' && status === '0') {
+      const model = GetModel(upperFirst(role_type));
+      await model.updateOne({ _id: id }, { status: '0' });
+    }
   }
 }