diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-11-20 11:44:58 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-11-20 11:44:58 -0800 |
commit | a582fcff5237e93aa3d61fc639c4c766e877ccac (patch) | |
tree | 0b6a590c7023e87b9d73cc4a034b3ae63acbfef9 /FS/FS/TicketSystem | |
parent | 7e78fde169d6e1b25c7e82a9bbcc399d87a2fa02 (diff) |
optimize
Diffstat (limited to 'FS/FS/TicketSystem')
-rw-r--r-- | FS/FS/TicketSystem/RT_External.pm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm index c2aac2d..9f07732 100644 --- a/FS/FS/TicketSystem/RT_External.pm +++ b/FS/FS/TicketSystem/RT_External.pm @@ -175,12 +175,11 @@ sub _from_customer { } else { - $where = - "AND 0 = ( SELECT COUNT(*) FROM ObjectCustomFieldValues - WHERE ObjectId = Tickets.id - AND ObjectType = 'RT::Ticket' - AND $customfield_sql - ) + $where = " AND NOT EXISTS ( SELECT 1 FROM ObjectCustomFieldValues + WHERE ObjectId = Tickets.id + AND ObjectType = 'RT::Ticket' + AND $customfield_sql + ) "; } |