transaction activeWithBuyer.js
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
73211c5b3b
commit
ec25df39e4
|
@ -813,7 +813,7 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d
|
|||
(13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT'),
|
||||
(14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT'),
|
||||
(15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'),
|
||||
(16, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'),
|
||||
(16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'),
|
||||
(71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT');
|
||||
|
||||
-- Update the taxClass after insert of the items
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('activeWithBuyer', {
|
||||
description: 'Returns active workers in itemType',
|
||||
|
@ -19,13 +18,18 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.activeWithBuyer = async filter => {
|
||||
const query =
|
||||
`SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname
|
||||
FROM worker w
|
||||
JOIN itemType i ON i.workerFk = w.id
|
||||
JOIN account.user u ON u.id = w.id`;
|
||||
Self.activeWithBuyer = async(filter, options) => {
|
||||
const myOptions = {};
|
||||
|
||||
return Self.activeWorkers(query, filter);
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const query =
|
||||
`SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname
|
||||
FROM worker w
|
||||
JOIN itemType i ON i.workerFk = w.id
|
||||
JOIN account.user u ON u.id = w.id`;
|
||||
|
||||
return Self.activeWorkers(query, filter, myOptions);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue