Merge pull request #26 from Pear-Trading/finn/LeaderboardFix
Leaderboards corrected and fixes
This commit is contained in:
commit
89aac53c02
8 changed files with 28 additions and 27 deletions
|
@ -201,10 +201,11 @@ sub startup {
|
||||||
while ( my $from_org_transaction = $from_org_transaction_rs->next ) {
|
while ( my $from_org_transaction = $from_org_transaction_rs->next ) {
|
||||||
$to_org->create_related(
|
$to_org->create_related(
|
||||||
'transactions', {
|
'transactions', {
|
||||||
buyer_id => $from_org_transaction->buyer_id,
|
buyer_id => $from_org_transaction->buyer_id,
|
||||||
value => $from_org_transaction->value,
|
value => $from_org_transaction->value,
|
||||||
proof_image => $from_org_transaction->proof_image,
|
proof_image => $from_org_transaction->proof_image,
|
||||||
submitted_at => $from_org_transaction->submitted_at,
|
submitted_at => $from_org_transaction->submitted_at,
|
||||||
|
purchase_time => $from_org_transaction->purchase_time,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$from_org_transaction->delete;
|
$from_org_transaction->delete;
|
||||||
|
|
|
@ -73,7 +73,7 @@ sub run {
|
||||||
seller_id => $organisations[int(rand($#organisations))]->organisation_id,
|
seller_id => $organisations[int(rand($#organisations))]->organisation_id,
|
||||||
value => int(rand(9999)) / 100,
|
value => int(rand(9999)) / 100,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($datetime->clone->add( minutes => int(rand(1440)) )),
|
purchase_time => $dtf->format_datetime($datetime->clone->add( minutes => int(rand(1440)) )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ sub search_between {
|
||||||
|
|
||||||
my $dtf = $self->result_source->schema->storage->datetime_parser;
|
my $dtf = $self->result_source->schema->storage->datetime_parser;
|
||||||
return $self->search({
|
return $self->search({
|
||||||
submitted_at => {
|
purchase_time => {
|
||||||
-between => [
|
-between => [
|
||||||
$dtf->format_datetime($from),
|
$dtf->format_datetime($from),
|
||||||
$dtf->format_datetime($to),
|
$dtf->format_datetime($to),
|
||||||
|
|
|
@ -73,7 +73,7 @@ for ( 11 .. 20 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_,
|
value => $_,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime(DateTime->today()->subtract( days => 5 )),
|
purchase_time => $dtf->format_datetime(DateTime->today()->subtract( days => 5 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ for ( 21 .. 30 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_,
|
value => $_,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime(DateTime->today()->subtract( days => 25 )),
|
purchase_time => $dtf->format_datetime(DateTime->today()->subtract( days => 25 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ for ( 31 .. 40 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_,
|
value => $_,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime(DateTime->today()->subtract( days => 50 )),
|
purchase_time => $dtf->format_datetime(DateTime->today()->subtract( days => 50 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,12 +100,12 @@ for ( 41 .. 50 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_,
|
value => $_,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime(DateTime->today()->subtract( days => 50 )),
|
purchase_time => $dtf->format_datetime(DateTime->today()->subtract( days => 50 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
is $user_result->transactions->search({
|
is $user_result->transactions->search({
|
||||||
submitted_at => {
|
purchase_time => {
|
||||||
-between => [
|
-between => [
|
||||||
$dtf->format_datetime(DateTime->today()),
|
$dtf->format_datetime(DateTime->today()),
|
||||||
$dtf->format_datetime(DateTime->today()->add( days => 1 )),
|
$dtf->format_datetime(DateTime->today()->add( days => 1 )),
|
||||||
|
|
|
@ -87,7 +87,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 9,
|
value => 9,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 1,
|
value => 1,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 5,
|
value => 5,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 3,
|
value => 3,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ for my $user ( $user1, $user2, $user3, $user4 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_ + $tweak,
|
value => $_ + $tweak,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 5 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 5 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ for my $user ( $user1, $user2, $user3, $user4 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_ + $tweak,
|
value => $_ + $tweak,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 25 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 25 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ for my $user ( $user1, $user2, $user3, $user4 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_ + $tweak,
|
value => $_ + $tweak,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 50 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 50 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 9,
|
value => 9,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 1,
|
value => 1,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 5,
|
value => 5,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ my $now = DateTime->today();
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => 3,
|
value => 3,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ for my $user ( $user1, $user2, $user3, $user4 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_ + $tweak,
|
value => $_ + $tweak,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 5 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 5 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ for my $user ( $user1, $user2, $user3, $user4 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_ + $tweak,
|
value => $_ + $tweak,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 25 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 25 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ for my $user ( $user1, $user2, $user3, $user4 ) {
|
||||||
seller_id => $org_result->id,
|
seller_id => $org_result->id,
|
||||||
value => $_ + $tweak,
|
value => $_ + $tweak,
|
||||||
proof_image => 'a',
|
proof_image => 'a',
|
||||||
submitted_at => $dtf->format_datetime($now->clone->subtract( days => 50 )),
|
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 50 )),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue