瀏覽代碼

If sort by field is missing, don't add it to order by

version-14
Anand Doshi 10 年之前
父節點
當前提交
09f687223b
共有 1 個檔案被更改,包括 9 行新增5 行删除
  1. +9
    -5
      frappe/public/js/frappe/views/reports/reportview.js

+ 9
- 5
frappe/public/js/frappe/views/reports/reportview.js 查看文件

@@ -187,17 +187,21 @@ frappe.views.ReportView = frappe.ui.Listing.extend({
}, },


get_order_by: function() { get_order_by: function() {
var order_by = [];

// first // first
var order_by = this.get_selected_table_and_column(this.sort_by_select)
+ ' ' + this.sort_order_select.val();
var sort_by_select = this.get_selected_table_and_column(this.sort_by_select);
if (sort_by_select) {
order_by.push(sort_by_select + " " + this.sort_order_select.val());
}


// second // second
if(this.sort_by_next_select.val()) { if(this.sort_by_next_select.val()) {
order_by += ', ' + this.get_selected_table_and_column(this.sort_by_next_select)
+ ' ' + this.sort_order_next_select.val();
order_by.push(this.get_selected_table_and_column(this.sort_by_next_select)
+ ' ' + this.sort_order_next_select.val());
} }


return order_by;
return order_by.join(", ");
}, },


get_selected_table_and_column: function(select) { get_selected_table_and_column: function(select) {


Loading…
取消
儲存