为Drupal Views提供自定义的Sort字段

这个可以通过Views PHP模块来实现,在Sort中添加一个Global PHP的Sort条件,然后选择
SQL Sort Code,注意这里返回Order By的字句

return 'abs(STRCMP(ifnull(term_data_node_data_field_radio_location__term_fields_term_term_country_value,\'ZZ\'), \''.$view->exposed_input['country'].'\'))';

在这里可以参考到View的exposed filter的值,通过$view->exposed_input['country']。