Merge branch 'MDL-57791_master-fix2' of git://github.com/dmonllao/moodle

This commit is contained in:
Andrew Nicols 2017-07-25 08:27:36 +08:00
commit e392b8bb2f
2 changed files with 3 additions and 1 deletions

View 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;