From 325ae4ad087cca1505fc0ff7306a2d5a7a53a2a3 Mon Sep 17 00:00:00 2001 From: Justin Lau Date: Tue, 25 Oct 2016 00:21:18 +0800 Subject: [PATCH 1/2] Return the latest uploaded (updated) file path. --- modules/backend/models/ImportModel.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/backend/models/ImportModel.php b/modules/backend/models/ImportModel.php index 01e457916..0739461ff 100644 --- a/modules/backend/models/ImportModel.php +++ b/modules/backend/models/ImportModel.php @@ -195,6 +195,7 @@ abstract class ImportModel extends Model $file = $this ->import_file() ->withDeferred($sessionKey) + ->orderBy('updated_at', 'desc') ->first() ; From 844d2d1b28e78f1383936b9e77cb5142b444b0df Mon Sep 17 00:00:00 2001 From: Justin Lau Date: Thu, 27 Oct 2016 00:31:44 +0800 Subject: [PATCH 2/2] Use `id` instead of `updated_at` for more consistent behavior --- modules/backend/models/ImportModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/models/ImportModel.php b/modules/backend/models/ImportModel.php index 0739461ff..8420b0328 100644 --- a/modules/backend/models/ImportModel.php +++ b/modules/backend/models/ImportModel.php @@ -195,7 +195,7 @@ abstract class ImportModel extends Model $file = $this ->import_file() ->withDeferred($sessionKey) - ->orderBy('updated_at', 'desc') + ->orderBy('id', 'desc') ->first() ;