Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
ccd6f5f1
Commit
ccd6f5f1
authored
Jan 11, 2021
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模版搜索列表
parent
be8fc2fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
template_manage.py
app/controller/template_manage.py
+3
-2
template_manage_service.py
app/service/template_manage_service.py
+11
-11
No files found.
app/controller/template_manage.py
View file @
ccd6f5f1
...
...
@@ -116,8 +116,9 @@ class TemplateList(Resource):
def
get
(
self
):
"""获取模版列表分页数据."""
self
.
parser
.
add_argument
(
'type'
,
type
=
int
,
required
=
True
,
help
=
'0为全部1为持仓报告2为诊断报告'
)
self
.
parser
.
add_argument
(
'pageNumber'
,
type
=
int
,
required
=
False
)
self
.
parser
.
add_argument
(
'pageSize'
,
type
=
int
,
required
=
False
)
self
.
parser
.
add_argument
(
'name'
,
type
=
str
,
required
=
False
,
help
=
'模版名称'
)
self
.
parser
.
add_argument
(
'pageNumber'
,
type
=
int
,
required
=
True
)
self
.
parser
.
add_argument
(
'pageSize'
,
type
=
int
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
[
'ifa_id'
]
=
self
.
ifa_id
data
=
get_template_list
(
args
)
...
...
app/service/template_manage_service.py
View file @
ccd6f5f1
...
...
@@ -117,19 +117,19 @@ def get_template_list(args):
pageSize
=
args
[
'pageSize'
]
offset
=
(
pageNumber
-
1
)
*
pageSize
dtype
=
args
.
get
(
'type'
)
name
=
args
.
get
(
'name'
,
''
)
conditions
=
[
FundReportManange
.
delete_tag
==
0
,
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
)
]
if
name
:
conditions
.
append
(
FundReportManange
.
name
.
like
(
'
%
'
+
name
+
'
%
'
))
if
dtype
!=
0
:
conditions
.
append
(
FundReportManange
.
type
==
args
.
get
(
'type'
))
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_session
=
tamp_diagnose_app
.
session
res
=
[]
if
dtype
==
0
:
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
FundReportManange
.
delete_tag
==
0
,
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
)
))
else
:
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
FundReportManange
.
delete_tag
==
0
,
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
),
FundReportManange
.
type
==
args
.
get
(
'type'
)
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
*
conditions
))
if
not
res
:
return
False
...
...
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