mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge branch '3.x' into 4.x
This commit is contained in:
@@ -66,6 +66,7 @@ class PrepareCsvExport implements ShouldQueue
|
||||
|
||||
/** @var Connection $databaseConnection */
|
||||
$databaseConnection = $query->getConnection();
|
||||
$databaseGrammar = $query->getGrammar();
|
||||
|
||||
if ($databaseConnection->getDriverName() === 'pgsql') {
|
||||
$originalOrders = collect($query->getQuery()->orders)
|
||||
@@ -76,11 +77,15 @@ class PrepareCsvExport implements ShouldQueue
|
||||
|
||||
return ($order['column'] ?? null) === $qualifiedKeyName;
|
||||
})
|
||||
->unique(function (array $order): string {
|
||||
->unique(function (array $order) use ($databaseGrammar): string {
|
||||
if (($order['type'] ?? null) === 'Raw') {
|
||||
return 'raw:' . ($order['sql'] ?? '');
|
||||
}
|
||||
|
||||
if ($databaseGrammar->isExpression($order['column'] ?? null)) {
|
||||
return 'expression:' . $order['column']->getValue($databaseGrammar);
|
||||
}
|
||||
|
||||
return 'column:' . ($order['column'] ?? '');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user