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
13604582
Commit
13604582
authored
Jan 22, 2021
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询客户列表
parent
dab0de34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
8 deletions
+58
-8
tamp_diagnose_app.py
app/model/tamp_diagnose_app.py
+50
-0
customer.py
app/service/customer.py
+8
-8
No files found.
app/model/tamp_diagnose_app.py
View file @
13604582
...
@@ -368,3 +368,53 @@ class UserHoldFundFromApp(Base, BaseModel):
...
@@ -368,3 +368,53 @@ class UserHoldFundFromApp(Base, BaseModel):
folio_name
=
Column
(
String
(
64
),
comment
=
'组合名称,默认是default'
)
folio_name
=
Column
(
String
(
64
),
comment
=
'组合名称,默认是default'
)
confirm_share_date
=
Column
(
Date
,
comment
=
'确认份额日期'
)
confirm_share_date
=
Column
(
Date
,
comment
=
'确认份额日期'
)
pay_date
=
Column
(
Date
,
comment
=
'订单支付时间'
)
pay_date
=
Column
(
Date
,
comment
=
'订单支付时间'
)
class
IfaCustomerView
(
Base
,
BaseModel
):
__tablename__
=
'ifa_customer_view'
id
=
Column
(
String
(
64
))
customer_id
=
Column
(
String
(
64
))
ifa_id
=
Column
(
String
(
64
))
fund_count
=
Column
(
INTEGER
(
11
))
revision
=
Column
(
INTEGER
(
11
))
delete_tag
=
Column
(
INTEGER
(
11
))
comefrom
=
Column
(
String
(
5
))
class
CustomerView
(
Base
,
BaseModel
):
__tablename__
=
'customer_view'
id
=
Column
(
String
(
64
))
customer_name
=
Column
(
String
(
128
))
delete_tag
=
Column
(
INTEGER
(
11
))
valueSex
=
Column
(
INTEGER
(
11
))
valueBirth
=
Column
(
DateTime
)
phone
=
Column
(
String
(
20
))
email
=
Column
(
String
(
120
))
landline
=
Column
(
String
(
20
))
address
=
Column
(
String
(
120
))
fax
=
Column
(
String
(
20
))
qq
=
Column
(
String
(
20
))
wechat
=
Column
(
String
(
30
))
wechatNickName
=
Column
(
String
(
30
))
weibo
=
Column
(
String
(
30
))
work
=
Column
(
String
(
50
))
staff
=
Column
(
String
(
50
))
school
=
Column
(
String
(
50
))
nativeplace
=
Column
(
String
(
30
))
valueMarry
=
Column
(
INTEGER
(
11
))
familyList
=
Column
(
String
(
500
))
favor
=
Column
(
String
(
100
))
concatTime
=
Column
(
String
(
30
))
wealth
=
Column
(
String
(
30
))
extra
=
Column
(
String
(
120
))
remark
=
Column
(
Text
)
group_id
=
Column
(
INTEGER
(
11
))
company_address
=
Column
(
String
(
200
))
other_address
=
Column
(
String
(
200
))
member_since
=
Column
(
DateTime
)
last_seen
=
Column
(
DateTime
)
total_assets
=
Column
(
DECIMAL
(
22
,
6
))
floating_earnings
=
Column
(
DECIMAL
(
22
,
6
))
comefrom
=
Column
(
String
(
5
))
app/service/customer.py
View file @
13604582
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
from
sqlalchemy
import
and_
from
sqlalchemy
import
and_
from
app.api.engine
import
TAMP_SQL
,
tamp_diagnose_app_engine
from
app.api.engine
import
TAMP_SQL
,
tamp_diagnose_app_engine
from
app.model.tamp_diagnose_app
import
Customer
,
IfaCustomer
from
app.model.tamp_diagnose_app
import
Customer
,
IfaCustomer
,
IfaCustomerView
,
CustomerView
def
get_customer_list
(
args
):
def
get_customer_list
(
args
):
...
@@ -22,18 +22,18 @@ def get_customer_list(args):
...
@@ -22,18 +22,18 @@ def get_customer_list(args):
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_session
=
tamp_diagnose_app
.
session
tamp_diagnose_session
=
tamp_diagnose_app
.
session
customer_id_list
=
tamp_diagnose_session
.
query
(
IfaCustomer
.
customer_id
)
.
filter
(
and_
(
customer_id_list
=
tamp_diagnose_session
.
query
(
IfaCustomer
View
.
customer_id
)
.
filter
(
and_
(
IfaCustomer
.
ifa_id
==
ifa_id
,
IfaCustomer
View
.
ifa_id
==
ifa_id
,
IfaCustomer
.
delete_tag
==
0
,
IfaCustomer
View
.
delete_tag
==
0
,
))
.
all
()
))
.
all
()
customer_id_list
=
[
r
[
0
]
for
r
in
customer_id_list
]
customer_id_list
=
[
r
[
0
]
for
r
in
customer_id_list
]
conditions
=
[
conditions
=
[
Customer
.
id
.
in_
(
customer_id_list
),
Customer
View
.
id
.
in_
(
customer_id_list
),
Customer
.
delete_tag
==
0
,
Customer
View
.
delete_tag
==
0
,
]
]
if
name
:
if
name
:
conditions
.
append
(
Customer
.
customer_name
.
like
(
'
%
'
+
name
+
'
%
'
))
conditions
.
append
(
Customer
View
.
customer_name
.
like
(
'
%
'
+
name
+
'
%
'
))
customer_list
=
tamp_diagnose_session
.
query
(
Customer
)
.
filter
(
and_
(
customer_list
=
tamp_diagnose_session
.
query
(
Customer
View
)
.
filter
(
and_
(
*
conditions
*
conditions
))
.
all
()
))
.
all
()
allow_field
=
[
'id'
,
'customer_name'
,
'valueSex'
,
'phone'
]
allow_field
=
[
'id'
,
'customer_name'
,
'valueSex'
,
'phone'
]
...
...
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