holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r11459: LJSUP-10941: Need a page to display cert...

Committer: akanashin
LJSUP-10941: Need a page to display certain figures from the LiveJournal Shop
A   trunk/htdocs/admin/profit.bml
Added: trunk/htdocs/admin/profit.bml
===================================================================
--- trunk/htdocs/admin/profit.bml	                        (rev 0)
+++ trunk/htdocs/admin/profit.bml	2012-02-09 14:04:30 UTC (rev 11459)
@@ -0,0 +1,11 @@
+<?_code
+{
+BML::finish();
+use LJ::Pay::Wallet;
+use LJ::Pay::SelfPromo;
+my $dbh = LJ::get_db_writer;
+my $info = LJ::Pay::SelfPromo->current_promo_info;
+my ($selfpromo) = $dbh->selectrow_array("select sum(payitemprop.propval) from payments inner join payitems using(payid) inner join payitemprop on payitems.piid=payitemprop.piid and payitemprop.propname='selfpromo_profit' where payments.daterecv > '2012-01-01' and used != 'C' and method = 'wallet' and payitems.item='selfpromo';");
+return int($dbh->selectrow_array("select sum(amount) from payments where daterecv > '2012-01-01' and used != 'C' and method != 'wallet';")) . "," . int($selfpromo/LJ::Pay::Wallet::EXCHANGE_RATE) . "," . int($info ? $info->cost/LJ::Pay::Wallet::EXCHANGE_RATE : 0);
+}
+_code?>

Tags: akanashin, bml, holyandrew, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments