Created
March 20, 2014 17:56
-
-
Save MissAllSunday/9669911 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the right sort method depending on the cust field type. | |
if ($row['field_type'] != 'check') | |
$cpf['columns'][$row['col_name']]['sort'] = array( | |
'down' => 'LENGTH(t' . $row['col_name'] . '.value) > 0 ASC, IFNULL(t' . $row['col_name'] . '.value, 1=1) DESC, t' . $row['col_name'] . '.value DESC', | |
'up' => 'LENGTH(t' . $row['col_name'] . '.value) > 0 DESC, IFNULL(t' . $row['col_name'] . '.value, 1=1) ASC, t' . $row['col_name'] . '.value ASC' | |
); | |
else | |
$cpf['columns'][$row['col_name']]['sort'] = array( | |
'down' => 't' . $row['col_name'] . '.value DESC', | |
'up' => 't' . $row['col_name'] . '.value ASC' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment