refs #5652 feat:itemTrash_new
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
8218eb2a6b
commit
5f5a0645be
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLosesLastYear`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLoses`()
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT t.addressFk , a.nickname, c.name
|
SELECT t.addressFk , a.nickname, c.name
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
|
@ -8,7 +8,6 @@ BEGIN
|
||||||
JOIN client c ON a.clientFk = c.id
|
JOIN client c ON a.clientFk = c.id
|
||||||
WHERE c.typeFk = 'loses'
|
WHERE c.typeFk = 'loses'
|
||||||
AND a.isactive = 1
|
AND a.isactive = 1
|
||||||
AND t.created >= (CURRENT_DATE() - INTERVAL 1 YEAR)
|
|
||||||
GROUP BY t.addressFk;
|
GROUP BY t.addressFk;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('getAddress', {
|
Self.remoteMethod('getAddress', {
|
||||||
description: 'Get all activated address last year ',
|
description: 'Get all activated address client active',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
accepts: [],
|
accepts: [],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -14,7 +14,7 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getAddress = async() => {
|
Self.getAddress = async() => {
|
||||||
const query = `CALL vn.address_getLosesLastYear()`;
|
const query = `CALL vn.address_getLoses()`;
|
||||||
const [result] = await Self.rawSql(query);
|
const [result] = await Self.rawSql(query);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
describe('getAddress()', () => {
|
describe('getAddress()', () => {
|
||||||
it('return list of address last year', async() => {
|
fit('return list of address last year', async() => {
|
||||||
let response = await models.Address.getAddress();
|
let response = await models.Address.getAddress();
|
||||||
|
|
||||||
expect(response.length).toBeGreaterThan(0);
|
expect(response.length).toBeGreaterThan(0);
|
||||||
|
|
Loading…
Reference in New Issue