AdSpace has 100% coverage, aside from some conditionals in the set method.
Found and fixed an off by 1 error in displayImpressions that allowed boughtImpressions+1 impressions to be displayed.
This commit is contained in:
parent
47c55075f6
commit
906775d505
3 changed files with 28 additions and 7 deletions
|
|
@ -134,7 +134,8 @@ sub displayImpression {
|
|||
my ($id, $ad, $priority, $clicks, $clicksBought, $impressions, $impressionsBought) = $self->session->db->quickArray("select adId, renderedAd, priority, clicks, clicksBought, impressions, impressionsBought from advertisement where adSpaceId=? and isActive=1 order by nextInPriority asc limit 1",[$self->getId]);
|
||||
unless ($dontCount) {
|
||||
my $isActive = 1;
|
||||
if ($clicks >= $clicksBought && $impressions >= $impressionsBought) {
|
||||
if ($clicks >= $clicksBought && $impressions >= ($impressionsBought-1)) {
|
||||
#if ($clicks >= $clicksBought && $impressions >= $impressionsBought) {
|
||||
$isActive = 0;
|
||||
}
|
||||
$self->session->db->write("update advertisement set impressions=impressions+1, nextInPriority=?, isActive=? where adId=?",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue