From 8239d88c185b23e4ec139301613c800d14f5abd3 Mon Sep 17 00:00:00 2001 From: Mo Farouk <122031508+fmido88@users.noreply.github.com> Date: Mon, 10 Jul 2023 06:44:49 +0300 Subject: [PATCH] Add files via upload --- classes/transactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/transactions.php b/classes/transactions.php index 0d8b4e92..6a706d69 100644 --- a/classes/transactions.php +++ b/classes/transactions.php @@ -225,7 +225,7 @@ public static function get_user_balance($userid) { } else if ($source == self::SOURCE_MOODLE) { // Get the balance from the last transaction. - $record = $DB->get_records('enrol_wallet_transactions', ['userid' => $userid], 'id DESC', 'balance', 0, 1); + $record = $DB->get_records('enrol_wallet_transactions', ['userid' => $userid], 'timecreated DESC,id DESC', 'balance', 0, 1); // Getting the balance from last transaction. $key = array_key_first($record);