From 4ebe99f6adda59d7c986815d6fa0aa0477b1973f Mon Sep 17 00:00:00 2001 From: Finn Date: Fri, 2 Mar 2018 16:42:30 +0000 Subject: [PATCH] removed debug line and unneeded code --- .../LocalLoop/Controller/Api/Categories.pm | 24 ------------------- .../Result/ViewQuantisedTransactionPg.pm | 1 - .../Result/ViewQuantisedTransactionSQLite.pm | 1 - 3 files changed, 26 deletions(-) diff --git a/lib/Pear/LocalLoop/Controller/Api/Categories.pm b/lib/Pear/LocalLoop/Controller/Api/Categories.pm index 8113053..9569168 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Categories.pm @@ -38,33 +38,9 @@ sub post_category_list { } ); - my $month_transaction_rs = $c->schema->resultset('ViewQuantisedTransaction' . $driver)->search( - { - purchase_time => { - -between => [ - $dtf->format_datetime($start), - $dtf->format_datetime($end), - ], - }, - buyer_id => $entity->id, - }, - { - columns => [ - { - quantised => 'quantised_weeks', - value => 'value', - essential => 'essential', - } - ], - group_by => [ qw/ essential quantised_weeks / ], - order_by => { '-desc' => 'value' }, - } - ); - my $data = { categories => {}, essentials => {} }; for my $cat_trans ( $month_transaction_category_rs->all ) { - use Devel::Dwarn; Dwarn {$cat_trans->get_columns}; my $quantised = $c->db_datetime_parser->parse_datetime($cat_trans->get_column('quantised')); my $days = $c->format_iso_date( $quantised ) || 0; my $category = $cat_trans->get_column('category_id') || 0; diff --git a/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionPg.pm b/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionPg.pm index d9b0f05..91ceede 100644 --- a/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionPg.pm +++ b/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionPg.pm @@ -15,7 +15,6 @@ SELECT "value", "purchase_time", "buyer_id", "seller_id", - "essential", DATE_TRUNC('hour', "purchase_time") AS "quantised_hours", DATE_TRUNC('day', "purchase_time") AS "quantised_days", DATE_TRUNC('week', "purchase_time") AS "quantised_weeks" diff --git a/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionSQLite.pm b/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionSQLite.pm index a84c461..abf95dd 100644 --- a/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionSQLite.pm +++ b/lib/Pear/LocalLoop/Schema/Result/ViewQuantisedTransactionSQLite.pm @@ -15,7 +15,6 @@ SELECT "value", "purchase_time", "buyer_id", "seller_id", - "essential", DATETIME(STRFTIME('%Y-%m-%d %H:00:00',"purchase_time")) AS "quantised_hours", DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time")) AS "quantised_days", DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time", 'weekday 1')) AS "quantised_weeks"