Merge branch 'fix'

This commit is contained in:
Yuri Kuznetsov
2022-06-20 11:50:04 +03:00
2 changed files with 26 additions and 0 deletions

View File

@@ -254,9 +254,22 @@ class CaseObj extends Record
'emailAddress' => $emailAddress,
'name' => $contact->get('name'),
'entityType' => 'Contact',
'entityId' => $contact->getId(),
];
}
usort($dataList, function (stdClass $o1, stdClass $o2) use ($entity) {
if ($o1->entityId == $entity->get('contactId')) {
return -1;
}
if ($o2->entityId == $entity->get('contactId')) {
return +1;
}
return 0;
});
return $dataList;
}
}

View File

@@ -701,9 +701,22 @@ class Opportunity extends Record
'emailAddress' => $emailAddress,
'name' => $contact->get('name'),
'entityType' => 'Contact',
'entityId' => $contact->getId(),
];
}
usort($dataList, function (stdClass $o1, stdClass $o2) use ($entity) {
if ($o1->entityId == $entity->get('contactId')) {
return -1;
}
if ($o2->entityId == $entity->get('contactId')) {
return +1;
}
return 0;
});
return $dataList;
}
}