|
@@ -11,7 +11,8 @@ const XLSX = require('xlsx');
|
|
|
class SchoolService extends CrudService {
|
|
|
constructor(ctx) {
|
|
|
super(ctx, 'schoolctrl');
|
|
|
- this.model = this.ctx.model.Student;
|
|
|
+ this.model = this.ctx.model.School;
|
|
|
+ this.smodel = this.ctx.model.Student;
|
|
|
this.umodel = this.ctx.model.User;
|
|
|
}
|
|
|
|
|
@@ -32,7 +33,7 @@ class SchoolService extends CrudService {
|
|
|
}
|
|
|
// 将数据存入数据库中
|
|
|
for (const stu of studatas) {
|
|
|
- const res = await this.model.create(stu);
|
|
|
+ const res = await this.smodel.create(stu);
|
|
|
if (res) {
|
|
|
const newdata = { name: stu.name, mobile: stu.phone, type: '4', uid: res.id };
|
|
|
newdata.passwd = { secret: '12345678' };
|