|
@@ -11,6 +11,20 @@ class UploadtaskService extends CrudService {
|
|
|
constructor(ctx) {
|
|
|
super(ctx, 'uploadtask');
|
|
|
this.model = this.ctx.model.Uploadtask;
|
|
|
+ this.stumodel = this.ctx.model.Student;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 elm of res) {
|
|
|
+ const _elm = _.cloneDeep(JSON.parse(JSON.stringify(elm)));
|
|
|
+ const stu = await this.stumodel.findById(_elm.studentid);
|
|
|
+ _elm.stuname = stu.name;
|
|
|
+ data.push(_elm);
|
|
|
+ }
|
|
|
+ return { data, total };
|
|
|
}
|
|
|
|
|
|
}
|