Procházet zdrojové kódy

字段使用错误

lrf před 1 rokem
rodič
revize
ec906282b7
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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;