當前位置: 首頁>>代碼示例>>PHP>>正文


PHP site::from_id方法代碼示例

本文整理匯總了PHP中site::from_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP site::from_id方法的具體用法?PHP site::from_id怎麽用?PHP site::from_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在site的用法示例。


在下文中一共展示了site::from_id方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: cash

 public function cash()
 {
     $this->live_cash = 0;
     $this->played = 0;
     $this->cash = 0;
     $this->transactions = transaction::from_account($this->account_id);
     # här kommer transaktionerna
     foreach ($this->transactions as $transaction) {
         $transactions[] = $transaction;
         if ($transaction->type == "cash_in") {
             $this->cash += $transaction->amount;
         } elseif ($transaction->type == "bonus") {
             $this->cash += $transaction->amount;
         } elseif ($transaction->type == "cash_out") {
             $this->cash -= $transaction->amount;
         }
     }
     # här kommer betsen
     $this->bets = bet::from_account($this->account_id);
     foreach ($this->bets as $bet) {
         $bet->match = match::from_id($bet->match_id);
         $bet->account = account::from_id($bet->account_id);
         $bet->account->site = site::from_id($bet->account->site_id);
         $this->played += $bet->bet;
         if ($bet->match->result == "undecided") {
             $this->live_cash += $bet->bet;
             $this->cash -= $bet->bet;
         } else {
             $this->cash -= $bet->bet;
             $this->cash += $bet->result;
         }
     }
     return $this->cash;
 }
開發者ID:daivan,項目名稱:clearbonus,代碼行數:34,代碼來源:accounts_model.php

示例2: profile

 function profile()
 {
     $match_id = $_GET['match_id'];
     $match = match::from_id($match_id);
     $bets = bet::from_match($match_id);
     foreach ($bets as $bet) {
         $bet->account = account::from_id($bet->account_id);
         $bet->account->site = site::from_id($bet->account->site_id);
         $bet->match = match::from_id($bet->match_id);
     }
     $data['match'] = $match;
     $data['bets'] = $bets;
     $this->view('matches/profile_view.php', $data, 'main_template.php');
 }
開發者ID:daivan,項目名稱:clearbonus,代碼行數:14,代碼來源:matches_controller.php

示例3: profile

 function profile()
 {
     $id = $_GET['user_id'];
     $user = user::from_id($id);
     $user->accounts = account::from_user($user->user_id);
     $bets = array();
     $calculation['cash_in'] = 0;
     $calculation['cash_out'] = 0;
     $calculation['bonus'] = 0;
     foreach ($user->accounts as $account) {
         # räkna ut alla pengar
         $account->transactions = transaction::from_account($account->account_id);
         foreach ($account->transactions as $transaction) {
             $transactions[] = $transaction;
             if ($transaction->type == "cash_in") {
                 $calculation['cash_in'] += $transaction->amount;
             } elseif ($transaction->type == "bonus") {
                 $calculation['bonus'] += $transaction->amount;
             } elseif ($transaction->type == "cash_out") {
                 $calculation['cash_out'] -= $transaction->amount;
             }
         }
         $account->cash();
     }
     $bets = bet::from_user($id);
     foreach ($bets as $bet) {
         $bet->match = match::from_id($bet->match_id);
         $bet->account = account::from_id($bet->account_id);
         $bet->account->site = site::from_id($bet->account->site_id);
     }
     $data['calculation'] = $calculation;
     $data['user'] = $user;
     $data['bets'] = $bets;
     if (!empty($transactions)) {
         $data['transactions'] = $transactions;
     }
     $this->view('users/profile_view.php', $data, 'main_template.php');
 }
開發者ID:daivan,項目名稱:clearbonus,代碼行數:38,代碼來源:users_controller.php


注:本文中的site::from_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。