Commit 80130880 authored by pengxiong's avatar pengxiong

customer_name

parent aca7b67a
......@@ -231,6 +231,12 @@ class ReportView(Base, BaseModel):
file = pdf_folder + self.file
data = {c: int(getattr(self, c).timestamp()) if isinstance(getattr(self, c), datetime.datetime) else getattr(self, c) for c in allow_field}
data['file'] = file
if not self.customer_name:
with TAMP_SQL(tamp_diagnose_app_engine) as tamp_diagnose_app:
tamp_diagnose_session = tamp_diagnose_app.session
res = tamp_diagnose_session.query(CustomerView.customer_name).filter(CustomerView.id == self.customer_id)
if res.all():
data['customer_name'] = res[0].customer_name
return data
......@@ -373,7 +379,7 @@ class UserHoldFundFromApp(Base, BaseModel):
class IfaCustomerView(Base, BaseModel):
__tablename__ = 'ifa_customer_view'
id = Column(String(64))
id = Column(String(64), primary_key=True)
customer_id = Column(String(64))
ifa_id = Column(String(64))
fund_count = Column(INTEGER(11))
......@@ -385,7 +391,7 @@ class IfaCustomerView(Base, BaseModel):
class CustomerView(Base, BaseModel):
__tablename__ = 'customer_view'
id = Column(String(64))
id = Column(String(64), primary_key=True)
customer_name = Column(String(128))
delete_tag = Column(INTEGER(11))
valueSex = Column(INTEGER(11))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment