Merge pull request #87 from Pear-Trading/finn/applegacy
reverted fix and did different fix to order_by
This commit is contained in:
commit
38f8883ab1
3 changed files with 5 additions and 17 deletions
|
@ -18,10 +18,7 @@ sub transaction_data {
|
|||
columns => [
|
||||
{
|
||||
quantised => $quantised_column,
|
||||
count => $c->pg_or_sqlite(
|
||||
'count',
|
||||
"COUNT(*)",
|
||||
),
|
||||
count => \"COUNT(*)",
|
||||
sum_distance => $c->pg_or_sqlite(
|
||||
'SUM("me"."distance")',
|
||||
'SUM("me"."distance")',
|
||||
|
|
|
@ -86,10 +86,7 @@ sub post_customer {
|
|||
columns => [
|
||||
{
|
||||
quantised => 'quantised_weeks',
|
||||
count => $c->pg_or_sqlite(
|
||||
'count',
|
||||
"COUNT(*)",
|
||||
),
|
||||
count => \"COUNT(*)",
|
||||
}
|
||||
],
|
||||
group_by => 'quantised_weeks',
|
||||
|
@ -106,13 +103,10 @@ sub post_customer {
|
|||
join => { 'seller' => 'organisation' },
|
||||
columns => {
|
||||
sector => "organisation.sector",
|
||||
count => $c->pg_or_sqlite(
|
||||
'count',
|
||||
"COUNT(*)",
|
||||
),
|
||||
count => \"COUNT(*)",
|
||||
},
|
||||
group_by => "organisation.sector",
|
||||
order_by => { '-desc' => "COUNT(*)" },
|
||||
order_by => { '-desc' => $c->pg_or_sqlite('count',"COUNT(*)",)},
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -112,10 +112,7 @@ sub _purchases_avg_spend_duration {
|
|||
columns => [
|
||||
{
|
||||
quantised => 'quantised_days',
|
||||
count => $c->pg_or_sqlite(
|
||||
'count',
|
||||
"COUNT(*)",
|
||||
),
|
||||
count => \"COUNT(*)",
|
||||
sum_value => $c->pg_or_sqlite(
|
||||
'SUM("me"."value")',
|
||||
'SUM("me"."value")',
|
||||
|
|
Reference in a new issue