I am using "contao-news-sorting" module from github for sorting my news based on a rank value. This rank field is extended in news dca. I am able to sort it in ascending order. But the problem is, when the rank field is empty. It by default take the empty value as zero and it gets displayed at first. I actually need such empty values to get displayed at bottom. What can I do for that?. My code is
public function fetchrankItems($newsArchives, $blnFeatured, $limit, $offset, $objModule) {
$newsobject= \NewsModel::findPublishedByPids($newsArchives, $blnFeatured, $limit, $offset);
$t = \NewsModel::getTable();
$arrOptions = array();
switch ($objModule->news_sorting)
{
case 'sort_rankid_asc':
$arrOptions['order'] = "$t.rankid ASC";
break;
case 'sort_random':
$arrOptions['order'] = "RAND()";
break;
default:
$arrOptions['order'] = "$t.date DESC";
}
return \NewsModel::findPublishedByPids($newsArchives, $blnFeatured, $limit, $offset, $arrOptions);
}