lrf402788946 4 anos atrás
pai
commit
f58bfc2c50

+ 4 - 2
app/controller/.experience.js

@@ -1,6 +1,7 @@
 module.exports = {
   create: {
     requestBody: [
+      "planid",
       "termid",
       "batchid",
       "classid",
@@ -16,6 +17,7 @@ module.exports = {
   update: {
     params: ["!id"],
     requestBody: [
+      "planid",
       "termid",
       "batchid",
       "classid",
@@ -51,12 +53,12 @@ module.exports = {
   docx: {
     parameters: {
       query: {
-        planid:"planid",
+        planid: "planid",
         termid: "termid",
         batchid: "batchid",
         classid: "classid",
         studentid: "studentid",
-        id:"id",
+        id: "id",
       },
     },
     service: "exportDocx",

+ 1 - 0
app/model/experience.js

@@ -4,6 +4,7 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
 // 职责说明表
 const ExperienceSchema = {
+  planid: { type: String, required: false }, // 计划id
   termid: { type: String, required: false }, // 班级id
   batchid: { type: String, required: false }, // 班级id
   classid: { type: String, ref: 'Class' }, // 班级id

+ 1 - 1
app/service/experience.js

@@ -14,7 +14,7 @@ class ExperienceService extends CrudService {
   }
 
   async query(data, { skip, limit }) {
-    let res = await this.model.find().populate({ path: 'studentid', select: 'name job' }).skip(parseInt(skip))
+    let res = await this.model.find(data).populate({ path: 'studentid', select: 'name job' }).skip(parseInt(skip))
       .limit(parseInt(limit));
     if (res.length > 0) {
       res = JSON.parse(JSON.stringify(res));