Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
124f7fce
There was a problem fetching the pipeline summary.
Commit
124f7fce
authored
7 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Patches
Plain Diff
Add city to offer_projection in /enrollment
parent
19c78f53
No related branches found
No related tags found
1 merge request
!116
Release v1.0.0
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/middlewares/reqQueryFields.js
+1
-0
1 addition, 0 deletions
src/libs/middlewares/reqQueryFields.js
src/libs/routes/enrollment.js
+22
-4
22 additions, 4 deletions
src/libs/routes/enrollment.js
with
23 additions
and
4 deletions
src/libs/middlewares/reqQueryFields.js
+
1
−
0
View file @
124f7fce
...
@@ -185,6 +185,7 @@ class ReqQueryFields {
...
@@ -185,6 +185,7 @@ class ReqQueryFields {
if
(
typeof
values
[
k
]
!==
'
undefined
'
)
{
if
(
typeof
values
[
k
]
!==
'
undefined
'
)
{
// Clonamos para não alterar o original
// Clonamos para não alterar o original
let
value
=
_
.
clone
(
values
[
k
]);
let
value
=
_
.
clone
(
values
[
k
]);
if
(
value
.
parseOnly
)
return
;
// Checa se não fizemos o join para este valor e se é necessário fazer
// Checa se não fizemos o join para este valor e se é necessário fazer
if
(
!
hasJoined
[
value
.
table
]
&&
typeof
value
.
join
!==
'
undefined
'
)
{
if
(
!
hasJoined
[
value
.
table
]
&&
typeof
value
.
join
!==
'
undefined
'
)
{
let
foreignTable
=
''
;
let
foreignTable
=
''
;
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/enrollment.js
+
22
−
4
View file @
124f7fce
...
@@ -400,12 +400,30 @@ function schoolYearIdToStr(schoolYearId) {
...
@@ -400,12 +400,30 @@ function schoolYearIdToStr(schoolYearId) {
let
simRqf
=
new
ReqQueryFields
();
let
simRqf
=
new
ReqQueryFields
();
simRqf
.
addField
({
simRqf
.
addField
({
name
:
'
filter
'
name
:
'
filter
'
,
field
:
false
,
where
:
true
}).
addValue
({
}).
addValue
({
name
:
'
simulation_time
'
name
:
'
simulation_time
'
,
})
parseOnly
:
true
}).
addValue
({
name
:
'
city
'
,
table
:
'
municipio
'
,
tableField
:
'
nome
'
,
resultField
:
'
city_name
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
id
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
escola_municipio_id
'
,
foreignTable
:
'
matricula
'
}
});
enrollmentApp
.
get
(
'
/offer_projection
'
,
simRqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
enrollmentApp
.
get
(
'
/offer_projection
'
,
simRqf
.
parse
(),
simRqf
.
build
(),
(
req
,
res
,
next
)
=>
{
const
max_year
=
squel
.
select
()
const
max_year
=
squel
.
select
()
.
field
(
'
MAX(matricula.ano_censo)
'
)
.
field
(
'
MAX(matricula.ano_censo)
'
)
.
from
(
'
matricula
'
)
.
from
(
'
matricula
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment