ソースを参照

更新问卷完成度接口

reloaded 5 年 前
コミット
1d16c86e73
1 ファイル変更1 行追加1 行削除
  1. 1 1
      app/service/uploadquestion.js

+ 1 - 1
app/service/uploadquestion.js

@@ -63,7 +63,7 @@ class UploadquestionService extends CrudService {
       const stus = await this.smodel.find({ classid: typeid });
       const stus = await this.smodel.find({ classid: typeid });
       for (const elm of stus) {
       for (const elm of stus) {
         // 取得当前期学生答问卷数
         // 取得当前期学生答问卷数
-        const answer = await this.model.find({ studentid: elm.id, questionnaireid });
+        const answer = await this.model.findOne({ studentid: elm.id, questionnaireid });
         let completion = '';
         let completion = '';
         if (answer) {
         if (answer) {
           completion = '100%';
           completion = '100%';