Merge remote-tracking branch 'origin/master'

This commit is contained in:
rusefi 2020-05-08 01:33:17 -04:00
commit 3c507c0042
1 changed files with 3 additions and 3 deletions

View File

@ -74,9 +74,9 @@ class utils
}
public function get_engines($user_id) {
$sql = 'SELECT m.file AS id, e.make AS make, e.code AS code FROM msqur_metadata m '.
'JOIN (SELECT id,name,make,code FROM msqur_engines WHERE user_id = ' . (int) $user_id . ') e '.
'WHERE m.engine = e.id GROUP BY e.name ORDER BY m.file DESC';
$sql = 'SELECT MAX(m.file) AS id, e.make AS make, e.code AS code FROM msqur_engines e ' .
'INNER JOIN msqur_metadata m ON m.engine = e.id WHERE (user_id = ' . (int) $user_id . ') '.
'GROUP BY e.name';
$result = $this->db->sql_query($sql);
$output = array();