Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added option to allow for selection of day you are saving a stat

for.
  • Loading branch information...
commit 84cc7e2b1d0d6d12b2bd08189d3dca17edaebba3 1 parent 8e56f5c
authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  plugins/Stats/Writer/Writer.pm
5  plugins/Stats/Writer/Writer.pm
@@ -42,10 +42,11 @@ sub createStatDaily {
42 42
 	my($self, $name, $value, $options) = @_;
43 43
 	$value = 0 unless $value;
44 44
 	$options ||= {};
  45
+	my $day = $options->{day} || $self->{_day};
45 46
 
46 47
 	my $section = $options->{section} || 'all';
47 48
 	my $insert = {
48  
-		'day'	=> $self->{_day},
  49
+		'day'	=> $day,
49 50
 		'name'	=> $name,
50 51
 		'value'	=> $value,
51 52
 	};
@@ -53,7 +54,7 @@ sub createStatDaily {
53 54
 
54 55
 	my $overwrite = $self->{_overwrite} || $options->{overwrite};
55 56
 	if ($overwrite) {
56  
-		my $where = "day=" . $self->sqlQuote($self->{_day})
  57
+		my $where = "day=" . $self->sqlQuote($day)
57 58
 			. " AND name=" . $self->sqlQuote($name);
58 59
 		$where .= " AND section=" . $self->sqlQuote($section);
59 60
 		$self->{_dbh}{AutoCommit} = 0;

0 notes on commit 84cc7e2

Please sign in to comment.
Something went wrong with that request. Please try again.