You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
695 B
23 lines
695 B
'use strict';
|
|
|
|
async function getPersonalTrainRecordList(ctx) {
|
|
try {
|
|
const { models } = ctx.fs.dc;
|
|
const { limit, page } = ctx.query;
|
|
let personalTrainDetail = await models.PersonalTraining.findAndCountAll({
|
|
offset: Number(page) * Number(limit),
|
|
limit: Number(limit),
|
|
order: [['id', 'ASC']]
|
|
});
|
|
ctx.status = 200
|
|
ctx.body = personalTrainDetail;
|
|
} catch (error) {
|
|
ctx.fs.logger.error(`path:${ctx.path},error:${error}`)
|
|
ctx.status = 400;
|
|
ctx.body = { name: 'FindError', message: '查询个人培训记录数据失败' }
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
getPersonalTrainRecordList
|
|
}
|
|
|