Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VeNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Hoang Mai Phuong
VeNJOB
Commits
86b7a4ee
Commit
86b7a4ee
authored
Jul 30, 2021
by
Nguyen Hoang Mai Phuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix page-ID2-ID3
parent
cdbb0669
Pipeline
#1374
failed with stages
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/controllers/city_controller.rb
+3
-2
app/models/city.rb
+2
-1
app/views/industry/list_industry.html.slim
+1
-1
No files found.
app/controllers/city_controller.rb
View file @
86b7a4ee
class
CityController
<
ApplicationController
def
list_city
@cities_vietnam
=
City
.
cities
(
City
::
REGION_VN_ID
)
@cities_international
=
City
.
cities
(
City
::
REGION_INTERNATIONAL_ID
)
@cities_vietnam
=
City
.
cities
_by_region
(
City
::
REGION_VN_ID
)
@cities_international
=
City
.
cities
_by_region
(
City
::
REGION_INTERNATIONAL_ID
)
end
end
\ No newline at end of file
app/models/city.rb
View file @
86b7a4ee
...
...
@@ -6,5 +6,5 @@ class City < ApplicationRecord
REGION_VN_ID
=
1
REGION_INTERNATIONAL_ID
=
2
scope
:top_cities
,
->
{
joins
(
:jobs
).
group
(
:name
).
order
(
'count_all DESC'
).
count
.
take
(
LATEST_CITY_NUMBER
)
}
scope
:cities
,
->
(
value
)
{
joins
(
:jobs
).
group
(
:name
).
having
(
'count_all >= ?'
,
1
).
where
(
"region_id =
#{
value
}
"
).
order
(
'count_all DESC'
).
count
}
scope
:cities
_by_region
,
->
(
value
)
{
joins
(
:jobs
).
group
(
:name
).
having
(
'count_all >= ?'
,
1
).
where
(
'region_id = ?'
,
value
).
order
(
'count_all DESC'
).
count
}
end
\ No newline at end of file
app/views/industry/list_industry.html.slim
View file @
86b7a4ee
...
...
@@ -2,7 +2,7 @@
.container
h3
.p-3
|
Industries
|
Industries
List
.row.my-3.text-center.fs-5
-
@industry_list
.
each
do
|
name
,
amount
|
.col-3.p-2.border.mb-1.fw-normal.bg-white
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment