Commit d42adbb5 authored by pengxiong's avatar pengxiong

查询报告

parent 1d2244ab
......@@ -147,11 +147,11 @@ class HoldDiagnoseReport(Base, BaseModel):
res = tamp_user_session.execute(sql)
sql2 = "select customer_name from tamp_diagnose_app.customer_view where id = '{}'".format(self.customer_id)
res2 = tamp_diagnose_app_session.execute(sql2)
if res:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
else:
data['author_name'] = ''
if res2:
if res2.fetchone():
data['customer_name'] = res2.fetchone()[0]
else:
data['customer_name'] = ''
......@@ -187,11 +187,11 @@ class HoldReport(Base, BaseModel):
res = tamp_user_session.execute(sql)
sql2 = "select customer_name from tamp_diagnose_app.customer_view where id = '{}'".format(self.customer_id)
res2 = tamp_diagnose_app_session.execute(sql2)
if res:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
else:
data['author_name'] = ''
if res2:
if res2.fetchone():
data['customer_name'] = res2.fetchone()[0]
else:
data['customer_name'] = ''
......@@ -227,11 +227,11 @@ class PeriodicReport(Base, BaseModel):
res = tamp_user_session.execute(sql)
sql2 = "select customer_name from tamp_diagnose_app.customer_view where id = '{}'".format(self.customer_id)
res2 = tamp_diagnose_app_session.execute(sql2)
if res:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
else:
data['author_name'] = ''
if res2:
if res2.fetchone():
data['customer_name'] = res2.fetchone()[0]
else:
data['customer_name'] = ''
......
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