Browse Source

字段使用错误

lrf 1 year ago
parent
commit
ec906282b7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/service/teacher.js

+ 2 - 1
app/service/teacher.js

@@ -55,7 +55,7 @@ class TeacherService extends CrudService {
     return await this.model.findById(id, '+file');
   }
   async create(data) {
-    const { name, mobile } = data;
+    const { name, phone: mobile } = data;
     const user = await this.umodel.findOne({ mobile });
     if (user) {
       throw new BusinessError(ErrorCode.DATA_EXIST, '电话已经存在');
@@ -93,6 +93,7 @@ class TeacherService extends CrudService {
     const { teachersid, zlscore, msscore, status, remark } = data;
     for (const teacherid of teachersid) {
       const teacher = await this.model.findById(teacherid);
+      console.log(status);
       teacher.status = status;
       if (zlscore) {
         teacher.zlscore = zlscore;