Skip to content

Commit b05791a

Browse files
committed
refactor(issue): simplify sync issues SQL query
remove unnecessary nested SELECT
1 parent 0e1761c commit b05791a

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

inc/issue.class.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,16 @@ public static function getSyncIssuesRequest() : AbstractQuery {
180180
],
181181
],
182182
[
183-
'TABLE' => new QuerySubquery([
184-
'SELECT' => '*',
185-
'FROM' => new QuerySubquery([
186-
'SELECT' => ['users_id', $ticketFk],
187-
'DISTINCT' => true,
188-
'FROM' => $ticketUserTable,
189-
'WHERE' => [
190-
'type' => CommonITILActor::REQUESTER,
191-
],
192-
'ORDER' => ['id ASC'],
193-
], 'inner_glpi_tickets_users'),
194-
'GROUPBY' => 'tickets_id'
195-
], 'glpi_tickets_users'),
183+
'TABLE' => new QuerySubQuery([
184+
'SELECT' => ['users_id', $ticketFk],
185+
'DISTINCT' => true,
186+
'FROM' => $ticketUserTable,
187+
'WHERE' => [
188+
'type' => CommonITILActor::REQUESTER,
189+
],
190+
'GROUPBY' => 'tickets_id',
191+
'ORDER' => ['id ASC']
192+
], $ticketUserTable),
196193
'FKEY' => [
197194
$ticketTable => 'id',
198195
$ticketUserTable => $ticketFk,

0 commit comments

Comments
 (0)