fixed the bug

pull/141/MERGE^2
hyh123a 2022-04-18 21:45:14 +08:00
parent b9b0264837
commit d34adf3dd3
1 changed files with 17 additions and 0 deletions

View File

@ -338,6 +338,20 @@ class TicketAgentListCollection:
cnx = mysql.connector.connect(**config.loonflow) cnx = mysql.connector.connect(**config.loonflow)
cursor = cnx.cursor() cursor = cnx.cursor()
# Get Ticket ids
query = (" SELECT id, ticket_id "
" FROM ticket_ticketuser "
" WHERE in_process = 1 and worked = 0 "
" ORDER BY id DESC ")
cursor.execute(query)
rows = cursor.fetchall()
ticket_ids = []
if rows is not None and len(rows) > 0:
for row in rows:
ticket_id = row[1]
ticket_ids.append(ticket_id)
query = (" SELECT id, name " query = (" SELECT id, name "
" FROM workflow_workflow " " FROM workflow_workflow "
" ORDER BY id ") " ORDER BY id ")
@ -372,6 +386,9 @@ class TicketAgentListCollection:
result = list() result = list()
if rows is not None and len(rows) > 0: if rows is not None and len(rows) > 0:
for row in rows: for row in rows:
_id = row[0]
if _id not in ticket_ids:
continue
meta_result = {"id": row[0], meta_result = {"id": row[0],
"title": row[1], "title": row[1],
"ticket_type": workflow_result.get(row[2]), "ticket_type": workflow_result.get(row[2]),