Refactor #1682 modificar modelos componentRate y componentTypeRate
This commit is contained in:
parent
faf355fab8
commit
bf5a9967cf
|
@ -0,0 +1,15 @@
|
|||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`component` AS
|
||||
SELECT
|
||||
`t`.`Id_Componente` AS `id`,
|
||||
`t`.`Componente` AS `name`,
|
||||
`t`.`tarifa_componentes_series_id` AS `typeFk`,
|
||||
`t`.`tarifa_class` AS `classRate`,
|
||||
`t`.`tax` AS `tax`,
|
||||
`t`.`is_renewable` AS `isRenewable`,
|
||||
`t`.`code` AS `code`
|
||||
FROM
|
||||
`bi`.`tarifa_componentes` `t`;
|
|
@ -3,7 +3,7 @@
|
|||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "componentRate"
|
||||
"table": "component"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
|
@ -24,7 +24,7 @@
|
|||
"isRenewable": {
|
||||
"type": "Number"
|
||||
},
|
||||
"componentTypeRate": {
|
||||
"typeFk": {
|
||||
"type": "Number"
|
||||
},
|
||||
"code": {
|
||||
|
@ -35,7 +35,7 @@
|
|||
"componentType": {
|
||||
"type": "belongsTo",
|
||||
"model": "ComponentTypeRate",
|
||||
"foreignKey": "componentTypeRate"
|
||||
"foreignKey": "typeFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "componentTypeRate"
|
||||
"table": "componentType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
|
|
|
@ -17,7 +17,7 @@ class Controller {
|
|||
include: {
|
||||
relation: 'componentRate',
|
||||
scope: {
|
||||
fields: ['componentTypeRate', 'name'],
|
||||
fields: ['typeFk', 'name'],
|
||||
include: {
|
||||
relation: 'componentType',
|
||||
scope: {
|
||||
|
|
|
@ -133,8 +133,8 @@ module.exports = {
|
|||
i.tag6, i.value6, i.tag7, i.value7
|
||||
FROM vn.sale s
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
LEFT JOIN componentRate cr ON cr.id = sc.componentFk
|
||||
LEFT JOIN componentTypeRate ctr ON ctr.id = cr.componentTypeRate
|
||||
LEFT JOIN component cr ON cr.id = sc.componentFk
|
||||
LEFT JOIN componentType ctr ON ctr.id = cr.typeFk
|
||||
LEFT JOIN item i ON i.id = s.itemFk
|
||||
LEFT JOIN ticket t ON t.id = s.ticketFk
|
||||
LEFT JOIN origin o ON o.id = i.originFk
|
||||
|
|
Loading…
Reference in New Issue