I wrote an override in Joomla 3.X and sorted the result from the DB using this query, which works:
$query = "SELECT content.*, fieldvalues.* FROM #__content AS content, #__fields_values AS fieldvalues WHERE content.catid=" . $catid . " AND content.id = fieldvalues.item_id AND fieldvalues.field_id=418 AND fieldvalues.value LIKE '%" . $sorttype . "%' ORDER BY fieldvalues.value ASC;";
I would like to sort this result in multiple ways. Actual sortfield is the author, but if an author has published multiple titles I would like to sort it also by release date, which will be
fieldvalues.field_id=412, but I have no idea how to create a functional SQL query.
Maybe you can help or give me a tip.