fixed the bug
parent
b9b0264837
commit
d34adf3dd3
|
@ -338,6 +338,20 @@ class TicketAgentListCollection:
|
|||
cnx = mysql.connector.connect(**config.loonflow)
|
||||
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 "
|
||||
" FROM workflow_workflow "
|
||||
" ORDER BY id ")
|
||||
|
@ -372,6 +386,9 @@ class TicketAgentListCollection:
|
|||
result = list()
|
||||
if rows is not None and len(rows) > 0:
|
||||
for row in rows:
|
||||
_id = row[0]
|
||||
if _id not in ticket_ids:
|
||||
continue
|
||||
meta_result = {"id": row[0],
|
||||
"title": row[1],
|
||||
"ticket_type": workflow_result.get(row[2]),
|
||||
|
|
Loading…
Reference in New Issue