Skip to content

Commit

Permalink
Get newest document from archive, not oldest.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Krämer committed Feb 11, 2020
1 parent b3bdf0a commit 8e63e37
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Models/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ private function archive(string $archive, array $arguments, bool $kopf = true)
try {

if($kopf) {
$result->push(DB::connection('bios2000')->table($tableName)->where($arguments)->get()->all());
$result->push(DB::connection('bios2000')->table($tableName)
->where($arguments)
->orderBy('VERSION', 'desc')
->get()->all());
} else {
$result->push(DB::connection('bios2000')->table($tableName)->where('POSITIONS_NR', '!=', null)->where($arguments)->get()->all());
$result->push(DB::connection('bios2000')->table($tableName)
->where('POSITIONS_NR', '!=', null)
->where($arguments)
->orderBy('VERSION', 'desc')
->get()->all());
}

} catch (Exception $e) {
Expand Down

0 comments on commit 8e63e37

Please sign in to comment.