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


PHP Member::find方法代码示例

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


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

示例1: _manage_platoon

 public static function _manage_platoon($div, $plt)
 {
     $division = Division::findByName(strtolower($div));
     $platoonId = Platoon::getIdFromNumber($plt, $division->id);
     if (!is_null($platoonId)) {
         $user = User::find(intval($_SESSION['userid']));
         $member = Member::find(intval($_SESSION['memberid']));
         if ($member->platoon_id == $platoonId || $user->role > 2 || User::isDev()) {
             $tools = Tool::find_all($user->role);
             $divisions = Division::find_all();
             $platoon = Platoon::findById($platoonId);
             $unassignedMembers = Platoon::unassignedMembers($platoonId, true);
             $squads = Squad::findByPlatoonId($platoonId);
             $memberCount = count((array) Platoon::members($platoonId));
             $js = 'manage';
             Flight::render('manage/platoon', compact('division', 'platoon', 'squads', 'unassignedMembers', 'memberCount'), 'content');
             Flight::render('layouts/application', compact('js', 'user', 'member', 'tools', 'divisions'));
         } else {
             // insufficient access
             Flight::redirect('404/', 404);
         }
     } else {
         // nonexistent platoon
         Flight::redirect('404/', 404);
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:26,代码来源:PlatoonController.php

示例2: overview

 public function overview()
 {
     $members = Member::find('all', ['order' => 'username']);
     $this->setViewData('members', $members);
     $schedules = Schedule::find('all', ['conditions' => ['date >= UNIX_TIMESTAMP()'], 'order' => 'date']);
     $this->setViewData('schedules', $schedules);
 }
开发者ID:realskudd,项目名称:breakfast,代码行数:7,代码来源:Index.class.php

示例3: loanAccountNumber

 public static function loanAccountNumber($loanaccount)
 {
     $member = Member::find($loanaccount->member->id);
     $count = count($member->loanaccounts);
     $count = $count + 1;
     //$count = DB::table('loanproducts')->where('member_id', '=', $loanaccount->member->id)->count();
     $loanno = $loanaccount->loanproduct->short_name . "-" . $loanaccount->member->membership_no . "-" . $count;
     return $loanno;
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:9,代码来源:Loanaccount.php

示例4: _doUsersOnline

 public static function _doUsersOnline()
 {
     if (isset($_SESSION['loggedIn'])) {
         $user = User::find(intval($_SESSION['userid']));
         $member = Member::find(intval($_SESSION['memberid']));
         Flight::render('user/online_list', compact('user', 'member'));
     } else {
         Flight::render('user/online_list');
     }
 }
开发者ID:higginsd,项目名称:Division-Tracker,代码行数:10,代码来源:ApplicationController.php

示例5: createAccount

 public static function createAccount($id)
 {
     $member = Member::find($id);
     $share = new Share();
     $acc = 'SH-' . $member->membership_no;
     $shareaccount = new Shareaccount();
     $shareaccount->member()->associate($member);
     $shareaccount->account_number = $acc;
     $shareaccount->opening_date = date('Y-m-d');
     $shareaccount->save();
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:11,代码来源:Shareaccount.php

示例6: _doDivisionThreadCheck

 public static function _doDivisionThreadCheck()
 {
     if (!empty($_POST['player'])) {
         $player = trim($_POST['player']);
         $member = Member::find(intval($_SESSION['memberid']));
         $gameThreads = DivisionThread::find_all($member->game_id);
         $js = 'check_threads';
         Flight::render('recruiting/thread_check', compact('js', 'gameThreads', 'player'));
     } else {
         echo "<span class='text-muted'>A valid player was not provided!</span>";
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:12,代码来源:RecruitingController.php

示例7: _authenticate

 public static function _authenticate()
 {
     if (User::isLoggedIn()) {
         $user = User::find(intval($_SESSION['userid']));
         $member = Member::find(intval($_SESSION['memberid']));
         $tools = Tool::find_all($user->role);
         $divisions = Division::find_all();
         Flight::render('layouts/auth', [], 'content');
         Flight::render('layouts/application', compact('user', 'member', 'tools', 'divisions'));
     } else {
         Flight::render('layouts/auth', [], 'content');
         Flight::render('layouts/application', compact('user', 'member', 'tools', 'divisions'));
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:14,代码来源:UserController.php

示例8: store

 /**
  * Store a newly created shareaccount in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Shareaccount::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $member = Member::find(Input::get('member_id'));
     $acc = 'SH-' . $member_no;
     $shareaccount = new Shareaccount();
     $shareaccount->member()->associate($member);
     $shareaccount->account_number = $acc;
     $shareaccount->opening_date = date();
     $shareaccount->save();
     return Redirect::route('shareaccounts.index');
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:20,代码来源:ShareaccountsController.php

示例9: actionLogin

 public function actionLogin()
 {
     $model = new Member();
     $email = $_REQUEST['email'];
     $passwd = md5($_REQUEST['passwd']);
     $arr = $model->find()->where(['email' => $email])->asArray()->one();
     if ($arr) {
         if ($arr['password'] == $passwd) {
             $res['code'] = '10200';
             $res['mess'] = 'success';
             $res['stat'] = '';
             exit(json_encode($res));
         }
     }
     print_r($arr);
     die;
 }
开发者ID:877762536,项目名称:jiekou,代码行数:17,代码来源:SiteController.php

示例10: _doBattlelogIdUpdate

function _doBattlelogIdUpdate()
{
    $members = array();
    $battlelog_names = objectToArray(Member::find(array('status_id' => 1, 'battlelog_name !%' => 0, 'battlelog_id' => 0)));
    $countNames = count($battlelog_names);
    echo "Fetched battlelog names. ({$countNames})<br /><br />";
    foreach ($battlelog_names as $row) {
        $battlelog_id = Member::getBattlelogId($row['battlelog_name']);
        if (!$battlelog_id['error']) {
            $sql = "UPDATE member SET battlelog_id = {$battlelog_id['id']} WHERE battlelog_name = '{$row['battlelog_name']}'";
            Flight::aod()->sql($sql)->one();
            echo "Added ID {$battlelog_id['id']} to {$row['battlelog_name']}<br />";
        } else {
            echo "ERROR: {$row['battlelog_name']} - {$battlelog_id['message']}<br />";
        }
    }
    echo "done syncing battlelog ids.";
}
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:18,代码来源:lib.php

示例11: _retentionNumbers

 public static function _retentionNumbers()
 {
     $user = User::find(intval($_SESSION['userid']));
     if ($user->role >= 3 || User::isDev()) {
         $member = Member::find(intval($_SESSION['memberid']));
         $tools = Tool::find_all($user->role);
         $divisions = Division::find_all();
         $recruited = Report::recruitedLast30days($member->game_id);
         $removed = Report::removedLast30days($member->game_id);
         $monthlyBreakdown = Report::recruitingWeekly($member->game_id);
         $byTheMonth = Report::recruitingByTheMonth($member->game_id);
         $js = 'report';
         Flight::render('reports/retention', compact('recruited', 'removed', 'js', 'monthlyBreakdown', 'byTheMonth'), 'content');
         Flight::render('layouts/application', array('user' => $user, 'member' => $member, 'tools' => $tools, 'divisions' => $divisions));
     } else {
         Flight::redirect('/404', 404);
     }
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:18,代码来源:ReportController.php

示例12: getUserProfile

 /**
  * This function shows user profile
  */
 public function getUserProfile()
 {
     if (Session::get('admin') == 'admin') {
         $user = User::where('username', '=', Session::get('username'))->get()->first();
         $userProfile = Admin::find($user->details_id);
         $userProfile->DOB = DateFormat::show($userProfile->DOB);
         return View::make('user.profile')->with('userProfile', $userProfile);
     }
     if (Session::get('employee') == 'employee') {
         $user = User::where('username', '=', Session::get('username'))->get()->first();
         $userProfile = Employee::find($user->details_id);
         $userProfile->DOB = DateFormat::show($userProfile->DOB);
         return View::make('user.profile')->with('userProfile', $userProfile);
     }
     if (Session::get('member') == 'member') {
         $user = User::where('username', '=', Session::get('username'))->get()->first();
         $userProfile = Member::find($user->details_id);
         $userProfile->DOB = DateFormat::show($userProfile->DOB);
         return View::make('user.profile')->with('userProfile', $userProfile);
     }
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:24,代码来源:UserController.php

示例13: postSignIn

 public function postSignIn()
 {
     // check validation
     $validator = Validator::make(Input::all(), array('username' => 'required', 'password' => 'required'));
     // if validation is failed it's redirected
     // to sign in page with validation errors
     if ($validator->fails()) {
         return Redirect::route('signin-get')->withErrors($validator)->withInput();
     } else {
         $remember = Input::has('remember') ? true : false;
         $auth = Auth::attempt(array('username' => Input::get('username'), 'password' => trim(Input::get('password')), 'active' => 1), $remember);
         if ($auth) {
             $user = User::where('username', '=', Input::get('username'))->get()->first();
             // Holding all important data
             // from database to session
             // variable
             Session::put('username', $user->username);
             Session::put('user_level', $user->user_level);
             Session::put('user_id', $user->id);
             Session::put('wc_msg', 1);
             if ($user->user_level === 'admin') {
                 Session::put('admin', 'admin');
                 Session::put('employee_id', Employee::find($user->details_id)->id);
                 return Redirect::intended('/admin');
             } elseif ($user->user_level === 'employee') {
                 Session::put('employee', 'employee');
                 Session::put('employee_id', Employee::find($user->details_id)->id);
                 return Redirect::intended('/employee');
             } elseif ($user->user_level === 'member') {
                 Session::put('member', 'member');
                 Session::put('member_id', Member::find($user->details_id)->id);
                 return Redirect::intended('/member');
             }
         } else {
             return View::make('userAuthentication.signin')->with('invalid', 'Invalid Username/Password.');
         }
     }
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:38,代码来源:SignController.php

示例14: importSavings

 public static function importSavings($member, $date, $savingaccount, $amount)
 {
     $member = Member::find($member[0]->id);
     $savingaccount = Savingaccount::find($savingaccount[0]->id);
     //check if account and member exists
     $savingtransaction = new Savingtransaction();
     $savingtransaction->date = $date;
     $savingtransaction->savingaccount()->associate($savingaccount);
     $savingtransaction->amount = $amount;
     $savingtransaction->type = 'credit';
     $savingtransaction->description = 'savings deposit';
     $savingtransaction->transacted_by = $member->fullname;
     $savingtransaction->save();
     foreach ($savingaccount->savingproduct->savingpostings as $posting) {
         if ($posting->transaction == 'deposit') {
             $debit_account = $posting->debit_account;
             $credit_account = $posting->credit_account;
         }
     }
     $data = array('credit_account' => $credit_account, 'debit_account' => $debit_account, 'date' => $date, 'amount' => $amount, 'initiated_by' => 'system', 'description' => 'cash deposit');
     $journal = new Journal();
     $journal->journal_entry($data);
     Audit::logAudit(date('Y-m-d'), Confide::user()->username, 'Savings imported', 'Savings', $amount);
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:24,代码来源:Savingtransaction.php

示例15: postAction

 public function postAction()
 {
     try {
         $id = Arr::get($_POST, 'id', null);
         $password = Arr::get($_POST, 'password', false);
         $email = Arr::get($_POST, 'email', '');
         $name = Arr::get($_POST, 'name', '');
         $birthday = Arr::get($_POST, 'birthday', '');
         $phone = Arr::get($_POST, 'phone', '');
         $address = Arr::get($_POST, 'address', '');
         if ($id === null) {
             throw new Exception('request error.');
         }
         $m = Member::find($id);
         if ($m == null) {
             throw new Exception('not found user');
         }
         if (!$password) {
             $password = trim($password);
             if (!empty($password)) {
                 $m->password = Hash::make($password);
             }
         }
         $m->email = $email;
         $m->name = $name;
         $m->birthday = $birthday;
         $m->phone = $phone;
         $m->address = $address;
         if (!$m->save()) {
             throw new Exception('store user error');
         }
         return Redirect::route('admin.member.list');
     } catch (Exception $e) {
         return Redirect::route('admin.member.list', array('message' => $e->getMessage()));
     }
 }
开发者ID:kettanyam,项目名称:20141001done,代码行数:36,代码来源:MemberController.php


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