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


PHP Member::getByNum方法代码示例

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


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

示例1: do_pushRootAccounts

 public function do_pushRootAccounts($arrAccounts)
 {
     if (!is_array($arrAccounts)) {
         throw new \Exception('Invalid data param.');
     }
     $con = \Propel::getConnection();
     if (!$con->beginTransaction()) {
         throw new \Exception('Could not begin transaction');
     }
     $now = time();
     try {
         foreach ($arrAccounts as $account) {
             $objAccount = \Member::getByNum($account['Num']);
             $transfers = isset($account['Transfers']) ? $account['Transfers'] : [];
             foreach ($transfers as $transfer) {
                 $objTransfer = $objAccount->getCurrentTransferBundle($transfer['Currency'], $con);
                 $objTransfer->createTransaction($objAccount, $transfer['Amount'], \Transaction::REASON_TRANSFER_TO_ROOT, null, $now, $con);
             }
         }
         throw new \Exception('test');
         if (!$con->commit()) {
             throw new \Exception('Could not commit transaction');
         }
     } catch (\Exception $e) {
         $con->rollBack();
         throw $e;
     }
     return true;
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:29,代码来源:accounts.php

示例2: getSystemAccount

 public static function getSystemAccount()
 {
     if (!self::$systemAccount) {
         self::$systemAccount = Member::getByNum(self::ACCOUNT_NUM_SYSTEM);
     }
     return self::$systemAccount;
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:7,代码来源:SystemStats.php

示例3: getRootAccount

 public static function getRootAccount()
 {
     if (!self::$rootAccount) {
         self::$rootAccount = Member::getByNum(self::ACCOUNT_NUM_ROOT);
     }
     return self::$rootAccount;
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:7,代码来源:SystemStats.php

示例4: action_do_reset_password

 public function action_do_reset_password()
 {
     $data = \Tbmt\Arr::initMulti($_REQUEST, ['num' => TYPE_STRING, 'exp' => TYPE_STRING, 'hash' => TYPE_STRING]);
     $newPassword = false;
     if (!empty($data['num']) || !empty($data['exp']) || !empty($data['hash'])) {
         $member = \Member::getByNum($data['num']);
         if ($member && Cryption::validatePasswordResetToken($data['num'], $data['exp'], $member->getEmail(), $data['hash']) && intval($data['exp']) + 3600 * 24 >= time()) {
             $newPassword = bin2hex(mcrypt_create_iv(8, MCRYPT_DEV_URANDOM));
             $member->setPassword($newPassword);
             $member->save();
         }
     }
     return ControllerDispatcher::renderModuleView(self::MODULE_NAME, CURRENT_MODULE_ACTION, ['newPassword' => $newPassword]);
 }
开发者ID:nikonehauser,项目名称:pt,代码行数:14,代码来源:manage.controller.php

示例5: getMail

 private function getMail($name)
 {
     switch ($name) {
         case 'FundsLevelUpgrade':
             return MailHelper::sendFundsLevelUpgrade(\Member::getByNum('102'), \Member::getByNum('105'));
         case 'FeeIncomeReferrer':
             return MailHelper::sendFeeIncomeReferrer(\Member::getByNum('102'), \Member::getByNum('105'));
         case 'FeeIncome':
             $member102 = \Member::getByNum('102');
             $member102->setReferrerId(\Member::getByNum('105')->getId());
             // Do not save!!
             return MailHelper::sendFeeIncome($member102);
         case 'FreeSignupConfirm':
             $member102 = \Member::getByNum('102');
             $member102->setReferrerId(\Member::getByNum('105')->getId());
             // Do not save!!
             return MailHelper::sendFreeSignupConfirm($member102);
         case 'NewFreeRecruitmentCongrats':
             return MailHelper::sendNewFreeRecruitmentCongrats(\Member::getByNum('102'), \Member::getByNum('105'));
     }
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:21,代码来源:debug.controller.php

示例6: action_do_dev_paying

 public function action_do_dev_paying()
 {
     if (!\Tbmt\Config::get('devmode', \Tbmt\TYPE_BOOL, false) || !isset($_REQUEST['fake_income_num'])) {
         throw new PageNotFoundException();
     }
     $member = \Member::getByNum($_REQUEST['fake_income_num']);
     $con = \Propel::getConnection();
     if (!$con->beginTransaction()) {
         throw new Exception('Could not begin transaction');
     }
     try {
         $member->onReceivedMemberFee(\Transaction::$BASE_CURRENCY, time(), false, $con);
         if (!$con->commit()) {
             throw new Exception('Could not commit transaction');
         }
     } catch (Exception $e) {
         $con->rollBack();
         throw $e;
     }
     return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => Session::getLogin(), 'tab' => 'dev_paying']);
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:21,代码来源:account.controller.php

示例7: testDirectorInviteDirectorWillReceiveSameParent

 public function testDirectorInviteDirectorWillReceiveSameParent()
 {
     $sylvheim = Member::getByNum(\SystemStats::ACCOUNT_SYLVHEIM);
     $marketingLeader = DbEntityHelper::createMember($sylvheim, ['Type' => Member::TYPE_MARKETINGLEADER]);
     $marketingLeader->reload(self::$propelCon);
     $marketingLeader2 = DbEntityHelper::createMemberWithInvitation($marketingLeader, Member::TYPE_MARKETINGLEADER, self::$singupFormData);
     /* Assert proper member type
        ---------------------------------------------*/
     $this->assertEquals(Member::TYPE_MARKETINGLEADER, $marketingLeader->getType());
     $this->assertEquals(Member::TYPE_MARKETINGLEADER, $marketingLeader2->getType());
     $this->assertEquals($marketingLeader->getReferrerId(), $marketingLeader2->getReferrerId());
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:12,代码来源:InvitationTest.php

示例8: testBuildCurrentCompleteUseCase

 public function testBuildCurrentCompleteUseCase()
 {
     // @see resources/docs/Test 13.04.2016.docx
     //
     $CEO = Member::getByNum(\SystemStats::ACCOUNT_NUM_CEO1);
     $CEO_total = new TransactionTotalsAssertions($CEO, $this);
     $this->totals['CEO1'] = $CEO_total;
     $sylvheim = Member::getByNum(\SystemStats::ACCOUNT_SYLVHEIM);
     $sylvheim_total = new TransactionTotalsAssertions($sylvheim, $this);
     $this->totals['sylvheim'] = $sylvheim_total;
     /**
      * director 01
      *
      */
     $director1 = DbEntityHelper::createMemberWithInvitation($sylvheim, ['type' => \Member::TYPE_MARKETINGLEADER, 'free_signup' => 1], ['firstName' => 'Director', 'lastName' => '01']);
     $director1_total = new TransactionTotalsAssertions($director1, $this);
     $this->totals['director1'] = $director1_total;
     $this->assertTotals();
     /**
      * Spender 01
      */
     $spender01 = DbEntityHelper::createSignupMember($director1, true, ['firstName' => 'spender', 'lastName' => '01']);
     $spender01_total = new TransactionTotalsAssertions($spender01, $this);
     $this->totals['spender01'] = $spender01_total;
     $CEO_total->add(Transaction::REASON_CEO1_BONUS);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $director1_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $director1_total->add(Transaction::REASON_PM_BONUS);
     $director1_total->add(Transaction::REASON_VL_BONUS);
     $director1_total->add(Transaction::REASON_OL_BONUS);
     $this->assertTotals();
     /**
      * Spender 02
      *
      * director 1 gets level 2
      */
     $spender02 = DbEntityHelper::createSignupMember($director1, true, ['firstName' => 'spender', 'lastName' => '02']);
     $spender02_total = new TransactionTotalsAssertions($spender02, $this);
     $this->totals['spender02'] = $spender02_total;
     $CEO_total->add(Transaction::REASON_CEO1_BONUS);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $director1_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $director1_total->add(Transaction::REASON_PM_BONUS);
     $director1_total->add(Transaction::REASON_VL_BONUS);
     $director1_total->add(Transaction::REASON_OL_BONUS);
     $this->assertTotals();
     /**
      * Spender 03
      */
     $spender03 = DbEntityHelper::createSignupMember($spender02, true, ['firstName' => 'spender', 'lastName' => '03']);
     $spender03_total = new TransactionTotalsAssertions($spender03, $this);
     $this->totals['spender03'] = $spender03_total;
     $CEO_total->add(Transaction::REASON_CEO1_BONUS);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_PM_BONUS);
     $sylvheim_total->add(Transaction::REASON_VL_BONUS);
     $sylvheim_total->add(Transaction::REASON_OL_BONUS);
     $spender02_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $this->assertTotals();
     /**
      * Spender 04
      */
     $spender04 = DbEntityHelper::createSignupMember($spender03, true, ['firstName' => 'spender', 'lastName' => '04']);
     $spender04_total = new TransactionTotalsAssertions($spender04, $this);
     $this->totals['spender04'] = $spender04_total;
     $CEO_total->add(Transaction::REASON_CEO1_BONUS);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_PM_BONUS);
     $sylvheim_total->add(Transaction::REASON_VL_BONUS);
     $sylvheim_total->add(Transaction::REASON_OL_BONUS);
     $spender03_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $this->assertTotals();
     /**
      * Spender 05
      */
     $spender05 = DbEntityHelper::createSignupMember($spender04, true, ['firstName' => 'spender', 'lastName' => '05']);
     $spender05_total = new TransactionTotalsAssertions($spender05, $this);
     $this->totals['spender05'] = $spender05_total;
     $CEO_total->add(Transaction::REASON_CEO1_BONUS);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_PM_BONUS);
     $sylvheim_total->add(Transaction::REASON_VL_BONUS);
     $sylvheim_total->add(Transaction::REASON_OL_BONUS);
     $spender04_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $this->assertTotals();
     /**
      * Spender 06
      */
     $spender06 = DbEntityHelper::createSignupMember($spender05, true, ['firstName' => 'spender', 'lastName' => '06']);
     $spender06_total = new TransactionTotalsAssertions($spender06, $this);
     $this->totals['spender06'] = $spender06_total;
     $CEO_total->add(Transaction::REASON_CEO1_BONUS);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_PM_BONUS);
//.........这里部分代码省略.........
开发者ID:nikonehauser,项目名称:ptclient,代码行数:101,代码来源:CustomerTestProtocols2.php

示例9: test_105_director_marketingleader_promoter

 public function test_105_director_marketingleader_promoter()
 {
     $sylvheim = Member::getByNum(\SystemStats::ACCOUNT_SYLVHEIM);
     $sylvheim_total = new TransactionTotalsAssertions($sylvheim, $this);
     $this->assertEquals(Member::FUNDS_LEVEL2, $sylvheim->getFundsLevel());
     /* advertise director
        ---------------------------------------------*/
     $director = DbEntityHelper::createMemberWithInvitation($sylvheim, Member::TYPE_MARKETINGLEADER);
     $director_total = new TransactionTotalsAssertions($director, $this);
     $this->assertEquals(0, $director->getAdvertisedCount());
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_LVL2);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_VL_BONUS);
     $sylvheim_total->add(Transaction::REASON_OL_BONUS);
     $sylvheim_total->add(Transaction::REASON_PM_BONUS);
     $sylvheim_total->assertTotals();
     /* director advertise orgleader
        ---------------------------------------------*/
     $orgleader = DbEntityHelper::createMemberWithInvitation($director, Member::TYPE_ORGLEADER);
     $orgleader_total = new TransactionTotalsAssertions($orgleader, $this);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $director_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $director_total->add(Transaction::REASON_VL_BONUS);
     $director_total->add(Transaction::REASON_OL_BONUS);
     $director_total->add(Transaction::REASON_PM_BONUS);
     // $orgleader wird sylvheim nachgestellt
     $this->assertEquals($orgleader->getParentId(), $sylvheim->getId());
     $sylvheim_total->assertTotals();
     $director_total->assertTotals();
     $this->assertEquals(1, $director->getAdvertisedCount());
     $this->assertEquals(Member::FUNDS_LEVEL1, $director->getFundsLevel());
     /* orgleader advertise promoter
        ---------------------------------------------*/
     $promoter = DbEntityHelper::createMemberWithInvitation($orgleader, Member::TYPE_PROMOTER);
     $promoter_total = new TransactionTotalsAssertions($promoter, $this);
     $this->assertEquals(1, $director->getAdvertisedCount());
     $this->assertEquals(Member::FUNDS_LEVEL1, $director->getFundsLevel());
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_VL_BONUS);
     $orgleader_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $orgleader_total->add(Transaction::REASON_OL_BONUS);
     $orgleader_total->add(Transaction::REASON_PM_BONUS);
     // $promoter wird sylvheim nachgestellt
     $this->assertEquals($promoter->getParentId(), $sylvheim->getId());
     $sylvheim_total->assertTotals();
     $director_total->assertTotals();
     $orgleader_total->assertTotals();
     /* promoter advertise member
        ---------------------------------------------*/
     $donator = DbEntityHelper::createSignupMember($promoter);
     $sylvheim_total->add(Transaction::REASON_ADVERTISED_INDIRECT);
     $sylvheim_total->add(Transaction::REASON_SYLVHEIM);
     $sylvheim_total->add(Transaction::REASON_VL_BONUS);
     $sylvheim_total->add(Transaction::REASON_OL_BONUS);
     $promoter_total->add(Transaction::REASON_ADVERTISED_LVL1);
     $promoter_total->add(Transaction::REASON_PM_BONUS);
     $this->assertEquals($donator->getParentId(), $sylvheim->getId());
     $sylvheim_total->assertTotals();
     $director_total->assertTotals();
     $orgleader_total->assertTotals();
     $promoter_total->assertTotals();
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:64,代码来源:CustomerTestProtocols.php

示例10: testTopLevelBonusSpreading

 public function testTopLevelBonusSpreading()
 {
     $ceo = Member::getByNum(\SystemStats::ACCOUNT_NUM_CEO1);
     $it = Member::getByNum(\SystemStats::ACCOUNT_NUM_IT);
     $sylvheim = Member::getByNum(\SystemStats::ACCOUNT_SYLVHEIM);
     $executive = Member::getByNum(\SystemStats::ACCOUNT_EXECUTIVE);
     $ceo_total = new TransactionTotalsAssertions($ceo, $this);
     $it_total = new TransactionTotalsAssertions($it, $this);
     $sylvheim_total = new TransactionTotalsAssertions($sylvheim, $this);
     $executive_total = new TransactionTotalsAssertions($executive, $this);
     // Any advertise any
     $any = DbEntityHelper::createSignupMember($executive);
     $ceo_total->add(Transaction::REASON_CEO1_BONUS, 1);
     $ceo_total->add(Transaction::REASON_VL_BONUS, 1);
     $ceo_total->add(Transaction::REASON_OL_BONUS, 1);
     $ceo_total->add(Transaction::REASON_PM_BONUS, 1);
     $ceo_total->add(Transaction::REASON_SYLVHEIM, 1);
     $it_total->add(Transaction::REASON_IT_BONUS, 1);
     // Sylvhelm gets nothing here!
     $ceo_total->assertTotals();
     $it_total->assertTotals();
     $sylvheim_total->assertTotals();
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:23,代码来源:BonusSpreadingTest.php


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