From 466f683aa626e777a6a014575eb27d9594d9425b Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 24 Jul 2017 17:45:31 +0200 Subject: [PATCH] MDL-57791 analytics: Compatibility with oracle Also moved predictions test to analytics/tests/prediction_test.php --- analytics/classes/manager.php | 4 +++- analytics/tests/{ma_test.php => prediction_test.php} | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename analytics/tests/{ma_test.php => prediction_test.php} (100%) diff --git a/analytics/classes/manager.php b/analytics/classes/manager.php index f95768d5f14..2f139ed0442 100644 --- a/analytics/classes/manager.php +++ b/analytics/classes/manager.php @@ -84,7 +84,9 @@ class manager { $params = array(); - $sql = "SELECT DISTINCT am.* FROM {analytics_models} am"; + $fields = 'am.id, am.enabled, am.trained, am.target, ' . $DB->sql_compare_text('am.indicators') . + ', am.timesplitting, am.version, am.timecreated, am.timemodified, am.usermodified'; + $sql = "SELECT DISTINCT $fields FROM {analytics_models} am"; if ($predictioncontext) { $sql .= " JOIN {analytics_predictions} ap ON ap.modelid = am.id AND ap.contextid = :contextid"; $params['contextid'] = $predictioncontext->id; diff --git a/analytics/tests/ma_test.php b/analytics/tests/prediction_test.php similarity index 100% rename from analytics/tests/ma_test.php rename to analytics/tests/prediction_test.php