浏览代码

字段使用错误

lrf 1 年之前
父节点
当前提交
ec906282b7
共有 1 个文件被更改,包括 2 次插入1 次删除
  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;