|
|
@ -85,7 +85,7 @@ class Users::QuestionBankService
|
|
|
|
def custom_sort(relations, sort_by, sort_direction)
|
|
|
|
def custom_sort(relations, sort_by, sort_direction)
|
|
|
|
case sort_by
|
|
|
|
case sort_by
|
|
|
|
when 'updated_at' then
|
|
|
|
when 'updated_at' then
|
|
|
|
relations.order(updated_at: sort_direction)
|
|
|
|
relations.order("updated_at #{sort_direction}, id desc")
|
|
|
|
when 'name' then
|
|
|
|
when 'name' then
|
|
|
|
relations.order("CONVERT(name USING gbk) COLLATE gbk_chinese_ci #{sort_direction}")
|
|
|
|
relations.order("CONVERT(name USING gbk) COLLATE gbk_chinese_ci #{sort_direction}")
|
|
|
|
when 'contributor' then
|
|
|
|
when 'contributor' then
|
|
|
|