当前位置: 首页>>代码示例>>PHP>>正文


PHP Transaction::getAmountForReason方法代码示例

本文整理汇总了PHP中Transaction::getAmountForReason方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::getAmountForReason方法的具体用法?PHP Transaction::getAmountForReason怎么用?PHP Transaction::getAmountForReason使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transaction的用法示例。


在下文中一共展示了Transaction::getAmountForReason方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createTransactionForReason

 public function createTransactionForReason(Member $transferOwner, $reason, $advertisedMemberId, $when, PropelPDO $con)
 {
     $amount = Transaction::getAmountForReason($reason);
     $transferOwner->addOutstandingTotal($amount, $this->getCurrency());
     $transaction = $this->addAmount($amount);
     $transaction->setReason($reason);
     $transaction->setRelatedId($advertisedMemberId);
     $transaction->setDate($when);
     $transaction->save($con);
     return $transaction;
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:11,代码来源:Transfer.php

示例2: createTransactionForReason

 public function createTransactionForReason(Member $transferOwner, $reason, $advertisedMemberId, $when, PropelPDO $con)
 {
     if ($reason === Transaction::REASON_CUSTOM_BONUS_LEVEL) {
         $amount = $transferOwner->getBonusLevel();
     } else {
         $amount = Transaction::getAmountForReason($reason);
     }
     $transferOwner->addOutstandingTotal($amount, $this->getCurrency());
     $transaction = $this->addAmount($amount);
     $transaction->setReason($reason);
     $transaction->setRelatedId($advertisedMemberId);
     $transaction->setDate($when);
     $transaction->save($con);
     return $transaction;
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:15,代码来源:Transfer.php

示例3: add

 public function add($reason, $quantity = 1)
 {
     $this->total += Transaction::getAmountForReason($reason) * $quantity;
     return $this;
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:5,代码来源:helper.php

示例4: getLocalizedTRA

 public static function getLocalizedTRA($transactinoReason)
 {
     return Localizer::numFormat(\Transaction::getAmountForReason($transactinoReason), 0);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:4,代码来源:MailHelper.php

示例5: testVariant12

 public function testVariant12()
 {
     /**
      * OL - Neues Mitglied
      * 22$
      * ------------------------------------------*/
     /* Setup
        ---------------------------------------------*/
     DbEntityHelper::setCon(self::$propelCon);
     list(list($IT, $VL, $OL, $PM, $VS2, $VS1), list($trfIT, $trfVL, $trfOL, $trfPM, $trfVS2, $trfVS1), ) = DbEntityHelper::setUpBonusMembers(true, ['VL' => false]);
     $new = DbEntityHelper::createSignupMember($OL);
     $trfIT += Transaction::getAmountForReason(Transaction::REASON_IT_BONUS);
     // $trfVL += Transaction::getAmountForReason(Transaction::REASON_VL_BONUS);
     $trfOL += Transaction::getAmountForReason(Transaction::REASON_OL_BONUS) + Transaction::getAmountForReason(Transaction::REASON_PM_BONUS) + Transaction::getAmountForReason(Transaction::REASON_ADVERTISED_LVL2);
     // $trfPM += Transaction::getAmountForReason(Transaction::REASON_PM_BONUS);
     // $trfVS2 += Transaction::getAmountForReason(Transaction::REASON_ADVERTISED_INDIRECT);
     // $trfVS1 += Transaction::getAmountForReason(Transaction::REASON_ADVERTISED_LVL1);
     $this->assertTransferTotal($trfIT, $IT);
     // $this->assertTransferTotal($trfVL, $VL);
     $this->assertTransferTotal($trfOL, $OL);
     $this->assertTransferTotal($trfPM, $PM);
     $this->assertTransferTotal($trfVS2, $VS2);
     $this->assertTransferTotal($trfVS1, $VS1);
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:24,代码来源:BonusSpreadingTest.php


注:本文中的Transaction::getAmountForReason方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。