Commit cff68d2c authored by pengxiong's avatar pengxiong

fix

parent 3ed27d47
......@@ -147,13 +147,15 @@ 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)
res = res.fetchone()
res2 = res2.fetchone()
if data:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
if res:
data['author_name'] = res[0]
else:
data['author_name'] = ''
if res2.fetchone():
data['customer_name'] = res2.fetchone()[0]
if res2:
data['customer_name'] = res2[0]
else:
data['customer_name'] = ''
data['type'] = 2
......@@ -188,13 +190,15 @@ 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)
res = res.fetchone()
res2 = res2.fetchone()
if data:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
if res:
data['author_name'] = res[0]
else:
data['author_name'] = ''
if res2.fetchone():
data['customer_name'] = res2.fetchone()[0]
if res2:
data['customer_name'] = res2[0]
else:
data['customer_name'] = ''
data['type'] = 1
......@@ -229,13 +233,15 @@ 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)
res = res.fetchone()
res2 = res2.fetchone()
if data:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
if res:
data['author_name'] = res[0]
else:
data['author_name'] = ''
if res2.fetchone():
data['customer_name'] = res2.fetchone()[0]
if res2:
data['customer_name'] = res2[0]
else:
data['customer_name'] = ''
data['type'] = 3
......
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