diff --git a/nc_http/core/func.py b/nc_http/core/func.py index e878e77..0e8a26e 100644 --- a/nc_http/core/func.py +++ b/nc_http/core/func.py @@ -7,7 +7,7 @@ from six import string_types def strip_value(data): """ - + 递归处理字符占位符 :param data: :return: """ @@ -92,6 +92,20 @@ def get_paging(limit=10): } +def get_sorting(): + """ + 获取排序参数 + :return: + """ + data = get_request_json() + if not data.get('order_field'): + return None + return { + 'order': data.get('order') or 'asc', + 'order_field': uncamelize(data.get('order_field')), + } + + def send_excel(file_handler, file_name, suffix='xlsx'): """ 发送 excel 文件