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


PHP account::from_user方法代码示例

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


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

示例1: create

 function create()
 {
     $user_id = $_GET['user_id'];
     $user = user::from_id($user_id);
     $accounts = account::from_user($user->user_id);
     $data['accounts'] = $accounts;
     $this->view('transactions/create_view.php', $data, 'main_template.php');
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:8,代码来源:transactions_controller.php

示例2: create

 function create()
 {
     $id = $_GET['user_id'];
     $user = user::from_id($id);
     $user->accounts = account::from_user($user->user_id);
     foreach ($user->accounts as $account) {
         $account->cash();
     }
     $matches = match::all_active();
     $data['matches'] = $matches;
     $data['accounts'] = $user->accounts;
     $this->view('bets/create_view.php', $data, 'main_template.php');
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:13,代码来源:bets_controller.php

示例3: create

 function create()
 {
     $user_id = $_GET['user_id'];
     $user = user::from_id($user_id);
     $user->accounts = account::from_user($user->user_id);
     $sites = site::all();
     foreach ($sites as $key => $site) {
         foreach ($user->accounts as $account) {
             if ($account->site_id == $site->site_id) {
                 unset($sites[$key]);
             }
         }
     }
     $data['sites'] = $sites;
     $this->view('accounts/create_view.php', $data, 'main_template.php');
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:16,代码来源:accounts_controller.php

示例4: home

 function home()
 {
     $masters = master::all();
     $data['masters'] = $masters;
     $data['total'] = 0;
     foreach ($masters as $master) {
         $data['total'] += $master->cash;
     }
     $users = user::all();
     foreach ($users as $user) {
         $user->accounts = account::from_user($user->user_id);
         $bets = array();
         $user->calculation['cash_in'] = 0;
         $user->calculation['cash_out'] = 0;
         $user->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") {
                     $user->calculation['cash_in'] += $transaction->amount;
                 } elseif ($transaction->type == "bonus") {
                     $user->calculation['bonus'] += $transaction->amount;
                 } elseif ($transaction->type == "cash_out") {
                     $user->calculation['cash_out'] -= $transaction->amount;
                 }
             }
             $account->cash();
         }
     }
     $data['users'] = $users;
     $sites = site::all();
     $data['sites'] = $sites;
     $matches = match::all_active();
     $data['matches'] = $matches;
     $this->view('index_view.php', $data, 'main_template.php');
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:38,代码来源:index_controller.php

示例5: 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


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