|
@@ -85,6 +85,19 @@ class UploadquestionService extends CrudService {
|
|
|
return newdata;
|
|
|
}
|
|
|
|
|
|
+ async query({ skip, limit, ...info }) {
|
|
|
+ const total = await this.model.count(info);
|
|
|
+ const res = await this.model.find(info).skip(Number(skip)).limit(Number(limit));
|
|
|
+ const data = [];
|
|
|
+ for (const _res of res) {
|
|
|
+ const elm = _.cloneDeep(JSON.parse(JSON.stringify(_res)));
|
|
|
+ const stu = await this.smodel.findById(elm.studentid);
|
|
|
+ elm.studentname = stu.name;
|
|
|
+ data.push(elm);
|
|
|
+ }
|
|
|
+ return { data, total };
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
module.exports = UploadquestionService;
|