2022-12-19 13:39:38 +00:00
|
|
|
module.exports = Self => {
|
|
|
|
Self.remoteMethod('getRate2', {
|
2022-12-21 11:55:11 +00:00
|
|
|
description: 'Return the rate2',
|
2022-12-19 13:39:38 +00:00
|
|
|
accessType: 'READ',
|
|
|
|
accepts: [
|
|
|
|
{
|
|
|
|
arg: 'fixedPriceId',
|
|
|
|
type: 'integer',
|
|
|
|
description: 'The fixedPrice Id',
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
arg: 'rate3',
|
2022-12-21 11:55:11 +00:00
|
|
|
type: 'number',
|
2022-12-19 13:39:38 +00:00
|
|
|
description: `The price rate 3`,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
returns: {
|
2022-12-21 11:55:11 +00:00
|
|
|
type: 'object',
|
2022-12-19 13:39:38 +00:00
|
|
|
root: true
|
|
|
|
},
|
|
|
|
http: {
|
|
|
|
path: `/getRate2`,
|
|
|
|
verb: 'GET'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-12-21 11:55:11 +00:00
|
|
|
Self.getRate2 = async(fixedPriceId, rate3, options) => {
|
|
|
|
const myOptions = {};
|
|
|
|
|
|
|
|
if (typeof options == 'object')
|
|
|
|
Object.assign(myOptions, options);
|
|
|
|
|
2022-12-19 13:39:38 +00:00
|
|
|
const [result] = await Self.rawSql(`SELECT vn.priceFixed_getRate2(?, ?) as rate2`,
|
2022-12-21 11:55:11 +00:00
|
|
|
[fixedPriceId, rate3], myOptions);
|
2022-12-19 14:06:59 +00:00
|
|
|
return result;
|
2022-12-19 13:39:38 +00:00
|
|
|
};
|
|
|
|
};
|