Selaa lähdekoodia

修改意见反馈

zs 1 vuosi sitten
vanhempi
commit
a67ec84e98

+ 7 - 1
src/entity/core/opinion.entity.ts

@@ -5,11 +5,17 @@ import { BaseModel } from 'free-midway-component';
 })
 export class Opinion extends BaseModel {
   @prop({ required: false, index: false, zh: '用户id' })
-  student: string;
+  user: string;
+  @prop({ required: false, index: false, zh: '用户类型' })
+  userType: string;
   @prop({ required: false, index: false, zh: '问题类型' })
   type: string;
   @prop({ required: false, index: false, zh: '问题描述' })
   brief: string;
+  @prop({ required: false, index: false, zh: '时间' })
+  time: string;
   @prop({ required: false, index: false, zh: '图片' })
   file: Array<any>;
+  @prop({ required: false, index: false, zh: '状态', default: '0' })
+  status: string;
 }

+ 0 - 2
src/entity/core/teacher.entity.ts

@@ -22,8 +22,6 @@ export class Teacher extends BaseModel {
   cardType: string;
   @prop({ required: false, index: true, zh: '身份证号码' })
   card: string;
-  @prop({ required: false, index: false, zh: '任课年限' })
-  years: string;
   @prop({ required: false, index: true, zh: '学历' })
   education: string;
   @prop({ required: false, index: false, zh: '学科' })

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

@@ -15,11 +15,17 @@ export class FVO_opinion {
   @ApiProperty({ description: '数据id' })
   _id: string = undefined;
   @ApiProperty({ description: '用户id' })
-  'student': string = undefined;
+  'user': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'userType': string = undefined;
   @ApiProperty({ description: '问题类型' })
   'type': string = undefined;
   @ApiProperty({ description: '问题描述' })
   'brief': string = undefined;
+  @ApiProperty({ description: '时间' })
+  'time': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
   @ApiProperty({ description: '图片' })
   'file': Array<any> = undefined;
 }
@@ -27,10 +33,12 @@ export class FVO_opinion {
 export class QDTO_opinion extends SearchBase {
   constructor() {
     const like_prop = [];
-    const props = [];
+    const props = ['userType'];
     const mapping = [];
     super({ like_prop, props, mapping });
   }
+  @ApiProperty({ description: '用户类型' })
+  'userType': string = undefined;
 }
 
 export class QVO_opinion extends FVO_opinion {
@@ -43,13 +51,22 @@ export class QVO_opinion extends FVO_opinion {
 export class CDTO_opinion {
   @ApiProperty({ description: '用户id' })
   @Rule(RuleType['string']().empty(''))
-  'student': string = undefined;
+  'user': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'userType': string = undefined;
   @ApiProperty({ description: '问题类型' })
   @Rule(RuleType['string']().empty(''))
   'type': string = undefined;
   @ApiProperty({ description: '问题描述' })
   @Rule(RuleType['string']().empty(''))
   'brief': string = undefined;
+  @ApiProperty({ description: '时间' })
+  @Rule(RuleType['string']().empty(''))
+  'time': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
   @ApiProperty({ description: '图片' })
   @Rule(RuleType['array']().empty(''))
   'file': Array<any> = undefined;

+ 3 - 6
src/interface/core/teacher.interface.ts

@@ -32,8 +32,6 @@ export class FVO_teacher {
   'cardType': string = undefined;
   @ApiProperty({ description: '身份证号码' })
   'card': string = undefined;
-  @ApiProperty({ description: '任课年限' })
-  'years': string = undefined;
   @ApiProperty({ description: '学历' })
   'education': string = undefined;
   @ApiProperty({ description: '学科' })
@@ -46,12 +44,14 @@ export class FVO_teacher {
   'brief': string = undefined;
   @ApiProperty({ description: '状态' })
   'status': string = undefined;
+  @ApiProperty({ description: '是否公开' })
+  'is_show': string = undefined;
 }
 
 export class QDTO_teacher extends SearchBase {
   constructor() {
     const like_prop = [];
-    const props = ['openid', 'nick_name', 'gender', 'age', 'phone', 'grade', 'card', 'education', 'college', 'learnStatus', 'brief', 'status'];
+    const props = ['openid', 'is_show', 'nick_name', 'gender', 'age', 'phone', 'grade', 'card', 'education', 'college', 'learnStatus', 'brief', 'status'];
     const mapping = [];
     super({ like_prop, props, mapping });
   }
@@ -118,9 +118,6 @@ export class CDTO_teacher {
   @ApiProperty({ description: '身份证号码' })
   @Rule(RuleType['string']().empty(''))
   'card': string = undefined;
-  @ApiProperty({ description: '任课年限' })
-  @Rule(RuleType['string']().empty(''))
-  'years': string = undefined;
   @ApiProperty({ description: '学历' })
   @Rule(RuleType['string']().empty(''))
   'education': string = undefined;

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

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