付智勇

no message

... ... @@ -100,4 +100,15 @@ studentMeetingController.prototype.getStudentMeetingByStudentId = async(ctx, nex
}
}
studentMeetingController.prototype.isAppointment = async(ctx, next)=>{
try {
var body = ctx.request.body;
let Appointment = await studentMeetingService.isAppointment(body);
return Appointment;
} catch (error) {
console.log(error)
throw error
}
}
module.exports = new studentMeetingController();
\ No newline at end of file
... ...
... ... @@ -57,6 +57,19 @@ router.get('/queryStudentMeeting/:teacherName',async (ctx, next) => {
})
/**
* 根据查询老师的预约
*/
router.post('/isAppointment',async (ctx, next) => {
try{
var data = await studentMeetingController.isAppointment(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
console.log(e)
status.catchError(ctx,400,e.message);
}
})
/**
* 查询站点的预约课程
*/
router.get('/getStudentMeetingBySite/:siteId',async (ctx, next) => {
... ...
... ... @@ -100,6 +100,7 @@ studentMeetingService.prototype.updateStudentMeetingBySite = async(id,data) =>{
}
studentMeetingService.prototype.getStudentMeetingByStudentId = async(id,page=1,pageno=8) =>{
try {
let querySql = `SELECT
3u.*, 3meet.meeting_name,
3meet.meeting_status meetingStatus,
... ... @@ -120,9 +121,21 @@ studentMeetingService.prototype.getStudentMeetingByStudentId = async(id,page=1,p
WHERE
3sm.student_id = '` +id+"'";;
querySql += ' AND 3sm.status != 5 ORDER BY 3sm.create_time DESC LIMIT '+(page-1)*pageno+' , ' +pageno
let sm = await sequelize.query(querySql);
return sm[0];
querySql += ' AND 3sm.status != 5 ORDER BY 3sm.create_time DESC LIMIT '+(page-1)*pageno+' , ' +pageno
let sm = await sequelize.query(querySql);
return sm[0];
} catch (error) {
throw error
}
}
studentMeetingService.prototype.isAppointment = async(body)=>{
try {
let Appointment = await studentMeeting.findAll({where:body});
return Appointment;
} catch (error) {
throw error;
}
}
module.exports = new studentMeetingService();
\ No newline at end of file
... ...