Use object properties in class method instead of passing them as parameters
This commit is contained in:
@@ -250,34 +250,34 @@ Aggregation.prototype.sql = function(psql, override, callback) {
|
||||
return callback(null, aggregationSql);
|
||||
};
|
||||
|
||||
Aggregation.prototype.getCategoriesCTESql = function(query, column, aggregation, aggregationColumn, isFloatColumn) {
|
||||
Aggregation.prototype.getCategoriesCTESql = function() {
|
||||
return `
|
||||
WITH
|
||||
${filteredQueryTpl({
|
||||
_isFloatColumn: isFloatColumn,
|
||||
_isFloatColumn: this._isFloatColumn,
|
||||
_query: this.query,
|
||||
_column: this.column,
|
||||
_aggregationColumn: aggregation !== 'count' ? aggregationColumn : null
|
||||
_aggregationColumn: this.aggregation !== 'count' ? this.aggregationColumn : null
|
||||
})},
|
||||
${summaryQueryTpl({
|
||||
_isFloatColumn: isFloatColumn,
|
||||
_query: query,
|
||||
_column: column,
|
||||
_aggregationColumn: aggregation !== 'count' ? aggregationColumn : null
|
||||
_isFloatColumn: this._isFloatColumn,
|
||||
_query: this.query,
|
||||
_column: this.column,
|
||||
_aggregationColumn: this.aggregation !== 'count' ? this.aggregationColumn : null
|
||||
})},
|
||||
${rankedCategoriesQueryTpl({
|
||||
_query: query,
|
||||
_column: column,
|
||||
_query: this.query,
|
||||
_column: this.column,
|
||||
_aggregation: this.getAggregationSql(),
|
||||
_aggregationColumn: aggregation !== 'count' ? aggregationColumn : null
|
||||
_aggregationColumn: this.aggregation !== 'count' ? this.aggregationColumn : null
|
||||
})},
|
||||
${categoriesSummaryMinMaxQueryTpl({
|
||||
_query: query,
|
||||
_column: column
|
||||
_query: this.query,
|
||||
_column: this.column
|
||||
})},
|
||||
${categoriesSummaryCountQueryTpl({
|
||||
_query: query,
|
||||
_column: column
|
||||
_query: this.query,
|
||||
_column: this.column
|
||||
})}
|
||||
`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user