module.exports = Self => { Self.installMethod('getLog', filterParams); function filterParams(params) { return { where: { originFk: params.itemFk }, skip: (params.page - 1) * params.size, limit: params.size, include: [{ relation: "item" }, { relation: "user", scope: { fields: ["name"] } }] }; } };