Committer: iaskarov
LJSUP-7902 Analytics pageU trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm 2011-02-10 08:42:00 UTC (rev 10010) +++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm 2011-02-10 08:46:35 UTC (rev 10011) @@ -6,6 +6,7 @@ use LJ::Pay::Util qw/ _err _get_dbh/; use DateTime; use LJ::TimeUtil; +use LJ::TryNBuy; sub item { return 'paidacct'; } @@ -387,7 +388,6 @@ }, undef, $userid); unless ($affected_rows) { - $add_sql = "DATE_ADD(GREATEST(IFNULL(paiduntil, NOW()), NOW()), INTERVAL $qtv $units)" unless $units eq 'epoch'; @@ -395,6 +395,12 @@ $dbh->do("UPDATE paiduser SET paiduntil=$add_sql" . "WHERE userid=?", undef, $userid) or return undef; + # Logging the case when user used try&buy before + } else { + my $tb_time = LJ::TryNBuy->already_used($u); + if($tb_time) { + LJ::statushistory_add($u->userid, undef, 'trynbuy_upgrade', 't&b enabled at:' . $tb_time); + } } # at this point the paid time has been applied. any failure could cause the