'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 }