protected function mergeOrderByAttributes(array $attributes, $alias = null)
{
if (!$this->isWildCardSelection() && !empty($this->orderBy)) {
$orderBy = $this->getAttributesForAlias(array_keys($this->orderBy), $alias);
foreach ($orderBy as $attribute) {
if (!in_array(MBString::strtolower($attribute), MBString::array_change_value_case($attributes))) {
$attributes[] = $attribute;
}
}
}
return $attributes;
}