Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
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
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
3641b2d7
Commit
3641b2d7
authored
Mar 31, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230331
parent
7106b95d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
apps/view_radar/view.py
+6
-5
No files found.
apps/view_radar/view.py
View file @
3641b2d7
...
...
@@ -63,7 +63,8 @@ def tendency():
else
:
enterprise
=
Enterprise
.
query
.
filter_by
()
yearn
=
2021
# 现在年份 固定成21
# yearn = 2021 # 现在年份 固定成21
yearn
=
datetime
.
now
()
.
year
+
1
# 现在年份 固定成21
scope
=
[
i
for
i
in
range
(
1980
,
yearn
)]
# 年份范围
months
=
[(
1
,
3
),
(
4
,
6
),
(
7
,
9
),
(
10
,
12
)]
# 季度
company_num_data
=
list
()
...
...
@@ -87,7 +88,7 @@ def tendency():
elif
select_time
==
2
:
# 2020年季度(修改为5年季度)
company_num_name
=
'新增量季度企业个数'
register_capital_name
=
'新增量季度注册资本'
for
yea
in
range
(
2016
,
2021
):
for
yea
in
range
(
2016
,
yearn
):
for
jd
in
range
(
len
(
months
)):
result
=
enterprise
.
filter
(
and_
(
extract
(
"year"
,
Enterprise
.
build_date
)
==
yea
,
extract
(
"month"
,
Enterprise
.
build_date
)
.
between
(
months
[
jd
][
0
],
...
...
@@ -102,7 +103,7 @@ def tendency():
elif
select_time
==
3
:
# 2020年月度(改为3年月度)
company_num_name
=
'新增量月度企业个数'
register_capital_name
=
'新增量月度注册资本'
for
yea
in
range
(
2018
,
2021
):
for
yea
in
range
(
2018
,
yearn
):
for
m
in
range
(
2
,
14
,
2
):
result
=
enterprise
.
filter
(
and_
(
extract
(
"year"
,
Enterprise
.
build_date
)
==
yea
,
extract
(
"month"
,
Enterprise
.
build_date
)
==
m
))
...
...
@@ -133,7 +134,7 @@ def tendency():
elif
select_time
==
2
:
# 2020年季度
company_num_name
=
'累积量季度企业个数'
register_capital_name
=
'累积量季度注册资本'
for
yea
in
range
(
2016
,
2021
):
for
yea
in
range
(
2016
,
yearn
):
for
jd
in
range
(
len
(
months
)):
result
=
enterprise
.
filter
(
and_
(
extract
(
"year"
,
Enterprise
.
build_date
)
==
yea
,
extract
(
"month"
,
Enterprise
.
build_date
)
<=
months
[
jd
][
1
]))
...
...
@@ -149,7 +150,7 @@ def tendency():
elif
select_time
==
3
:
# 2020年月度
company_num_name
=
'累积量月度企业个数'
register_capital_name
=
'累积量月度注册资本'
for
yea
in
range
(
2018
,
2021
):
for
yea
in
range
(
2018
,
yearn
):
for
m
in
range
(
2
,
14
,
2
):
result
=
enterprise
.
filter
(
and_
(
extract
(
"year"
,
Enterprise
.
build_date
)
==
yea
,
extract
(
"month"
,
Enterprise
.
build_date
)
<=
m
))
...
...
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