23 lines
523 B
JavaScript
23 lines
523 B
JavaScript
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"]
|
|
}
|
|
}]
|
|
};
|
|
}
|
|
};
|