MDL-57791 analytics: Compatibility with oracle
authorDavid Monllao <david.monllao@gmail.com>
Mon, 24 Jul 2017 15:45:31 +0000 (17:45 +0200)
committerDavid Monllao <david.monllao@gmail.com>
Mon, 24 Jul 2017 15:49:09 +0000 (17:49 +0200)
Also moved predictions test to analytics/tests/prediction_test.php

analytics/classes/manager.php
analytics/tests/prediction_test.php [moved from analytics/tests/ma_test.php with 100% similarity]

index f95768d..2f139ed 100644 (file)
@@ -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;