salix/services/item/common/methods/item-log/getLog.js

23 lines
523 B
JavaScript
Raw Normal View History

2018-02-07 07:49:27 +00:00
module.exports = Self => {
2018-02-07 12:48:55 +00:00
Self.installMethod('getLog', filterParams);
2018-02-07 07:49:27 +00:00
2018-02-07 12:48:55 +00:00
function filterParams(params) {
return {
where: {
2018-02-08 10:40:06 +00:00
originFk: params.itemFk
2018-02-07 12:48:55 +00:00
},
skip: (params.page - 1) * params.size,
limit: params.size,
include: [{
2018-02-08 10:40:06 +00:00
relation: "item"
},
{
2018-02-08 11:04:33 +00:00
relation: "user",
scope: {
fields: ["name"]
}
}]
2018-02-07 12:48:55 +00:00
};
}
2018-02-07 07:49:27 +00:00
};