本文整理汇总了PHP中Member::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::where方法的具体用法?PHP Member::where怎么用?PHP Member::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doLogin
/**
* 로그인 컨트롤러.
*/
public function doLogin($userid)
{
Input::merge(array('userid' => $userid));
array_map('trim', Input::only('userid', 'userpw'));
// 유효성 검사 rule
$rules = array('userid' => Member::CONSTRAINT_USERID, 'userpw' => Member::CONSTRAINT_USERPW);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
}
$member = Member::where(['userid' => Input::get('userid')])->where(['userpw' => Input::get('userpw')])->first();
if (isset($member) && $member->getKey() >= 0) {
// 토큰이 있다면 삭제.
if ($member->token()) {
$member->token()->delete();
}
// 새로운 토큰 발급.
$memberToken = new Membertoken();
$memberToken->token = Membertoken::getNewToken();
$memberToken->memberSeq = $member->getKey();
$memberToken->expiretime = Membertoken::getNewExpire();
$memberToken->save();
return Utils::result($memberToken->token);
} else {
return Utils::result(Utils::CANNOT_LOGIN, true);
}
}
示例2: testOpenIdUserAssociation
public function testOpenIdUserAssociation()
{
$username = 'sebastian@tipit.net';
$password = 'Koguryo@1981';
$member = Member::where('Email', '=', $username)->firstOrFail();
$this->assertTrue($member->checkPassword($password));
}
示例3: postAjaxLogin
public function postAjaxLogin()
{
try {
if (!isset($_POST)) {
throw new Exception('Request error');
}
$id = \Input::get('id', false);
$passwd = \Input::get('password', false);
if (!$id || !$password) {
throw new Exception('Parameter error');
}
$m = \Member::where('uid', '=', md5($id))->where('social', '=', 'rebeauty')->get();
if ($m == null) {
throw new Exception('Not founded');
}
if (!\Hash::check($passwd, $m->password)) {
throw new Exception('帳號或密碼錯誤');
}
// register user into Auth that is a global variable
\Auth::login($m);
return \Redirect::route('frontend.index');
} catch (Exception $e) {
return Response::json(array('status' => 'error', 'message' => $e->getMessage(), '_token' => csrf_token()));
}
}
示例4: search
public function search()
{
$keyword = Input::get('keyword');
// REDIRECT BACK TO HOMEPAGE IF EMPTY
if (empty($keyword)) {
return Redirect::to('/');
}
$this->data['members'] = Member::where('last_name', 'LIKE', "%{$keyword}%")->orWhere('first_name', 'LIKE', "%{$keyword}%")->orWhere('number', 'LIKE', "%{$keyword}%")->orderBy('last_name')->get();
return $this->layout->content = View::make('members_search', $this->data);
}
示例5: currentUserProfile
static function currentUserProfile()
{
if (Auth::check()) {
$id = Auth::user()->id;
$member = Member::where('user_id', '=', $id)->first()->id;
$profileUrl = action('ProfileController@getProfile', array('id' => $member));
return $profileUrl;
} else {
return false;
}
}
示例6: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//get all users
$users = User::all();
// and update new field external_identifier with member id
foreach ($users as $user) {
$email = $user->external_id;
$member = Member::where('Email', '=', $email)->first();
if (!is_null($member)) {
$user->external_identifier = $member->ID;
$user->save();
}
}
}
开发者ID:smarcet,项目名称:openstackid,代码行数:19,代码来源:2015_04_15_152300_update_identifier_on_openid_users_table.php
示例7: setUsername
public function setUsername($username)
{
$this->fail = false;
$this->member = Member::where('MemberEmail', $username)->get();
$this->petugas = Petugas::where('PetugasUsername', $username)->get();
if ($this->member->count() == 0 && $this->petugas->count() == 0) {
$this->fail = true;
} else {
if ($this->member->count() == 1) {
$this->type = "member";
} elseif ($this->petugas->count() == 1) {
$this->type = "petugas";
}
}
}
示例8: currentUsername
static function currentUsername()
{
if (Auth::check()) {
$id = Auth::user()->id;
if ($member = Member::where('user_id', '=', $id)->first()) {
if (!empty($member->name)) {
return $member->name;
} else {
return Auth::user()->username;
}
} else {
return 'Unknown';
}
} else {
return 'Unknown';
}
}
示例9: getVklogin
public function getVklogin()
{
$code = Input::get('code');
//OAuth::setHttpClient('CurlClient');
$vk = OAuth::consumer('Vkontakte', 'http://localhost/study_barter/public/users/vklogin');
//var_dump($code);
if (!empty($code)) {
$token = $vk->requestAccessToken($code);
$result = json_decode($vk->request('users.get?lang=ru&fields=photo_100,photo_200'), true);
$result = $result['response'][0];
//echo "<pre>";
//var_dump($result);
//echo "</pre>";
//die();
if ($user = User::where('vk_id', '=', $result['uid'])->first()) {
//die(var_dump($result));
$member = Member::where('user_id', '=', $user->id)->first();
$member->name = $result['first_name'];
$member->surname = $result['last_name'];
$member->avatar_url = $result['photo_100'];
$member->avatar_url_big = $result['photo_200'];
$member->save();
Auth::login($user);
return Redirect::to('/');
} else {
$user = new User();
$user->vk_id = $result['uid'];
$user->is_active = 1;
$user->save();
$member = new Member();
$member->user_id = $user->id;
$member->name = $result['first_name'];
$member->surname = $result['last_name'];
$member->avatar_url = $result['photo_100'];
$member->avatar_url_big = $result['photo_200'];
$member->save();
Auth::login($user);
Log::info("User [{$result['first_name']}] successfully logged in.");
return Redirect::to('/');
}
} else {
$url = $vk->getAuthorizationUri();
return Redirect::to((string) $url);
}
}
示例10: show
/**
* Display the specified resource.
*
* @param int $itemId
* @param string $key
* @return Response
*/
public function show($itemId, $key)
{
//
$retVal = array('status' => 'ERR', 'msg' => 'Invalid Session');
try {
$user = \Member::where('session_key', '=', $key)->exists();
if (!$user) {
return Response::json($retVal);
}
$comment = \Comments::where('itemid', '=', $itemId)->get();
if ($comment->count() > 0) {
$retVal = array('status' => 'OK', 'comments' => $comment->toArray());
} else {
$retVal = array('status' => 'ERR', 'msg' => 'beyond your imagination :)');
}
return Response::json($retVal);
} catch (ModelNotFoundException $e) {
}
}
示例11: DeadLineFinished
public static function DeadLineFinished()
{
date_default_timezone_set(config::$timezone);
$today = date("Y-m-d");
$orders = Order::where('to', '<', $today)->where('status', '=', 1)->orderBy('id', 'desc')->get();
$info = array();
$x = 0;
foreach ($orders as $order) {
$single = array();
$single['email'] = User::where('details_id', '=', $order->member->id)->where('user_level', '=', 'member')->get()->first()->email;
$single['movie name'] = Movie::where("id", '=', $order->movie_id)->get()->first()->name;
$single['first name'] = Member::where("id", '=', $order->member_id)->get()->first()->first_name;
$single['last name'] = Member::where("id", '=', $order->member_id)->get()->first()->last_name;
$info[$x++] = $single;
}
foreach ($info as $member) {
Mail::send('emails.deadlinefinishedorder', array('first_name' => $member['first name'], 'last_name' => $member['last name'], 'movie' => $member['movie name']), function ($message) use($member) {
$message->to($member['email'], $member['first name'])->subject('DVD Rental Notification');
});
}
return "Email has been successfully sent.";
}
示例12: team
public function team($id)
{
//add security to avoid stealing of information
$user = Auth::user();
Excel::create('roster', function ($excel) use($id) {
$excel->sheet('Sheetname', function ($sheet) use($id) {
$event = Team::find($id);
$team = array();
if ($event->children->count() > 0) {
foreach ($event->children as $e) {
foreach ($e->members as $member) {
$team[] = $member;
}
}
} else {
$team = Member::where('team_id', '=', $id)->with('team')->get();
}
$sheet->setOrientation('landscape');
$sheet->loadView('export.lacrosse.roster', ['members' => $team]);
});
})->download('xlsx');
}
示例13: index
/**
* Display a listing of the resource.
* GET /player
*
* @return Response
*/
public function index()
{
$user = Auth::user();
$title = 'League Together - Club';
$players = $user->players;
$invites = [];
//get player from follower
foreach ($players as $player) {
$member = Member::where('player_id', '=', $player->id)->where('accepted_on', '=', null)->where('declined_on', '=', null)->get();
$participant = Participant::where('player_id', '=', $player->id)->where('accepted_on', '=', null)->where('declined_on', '=', null)->get();
if ($member) {
foreach ($member as $data) {
$invites[] = $data;
}
}
if ($participant) {
foreach ($participant as $data) {
$invites[] = $data;
}
}
}
return View::make('app.account.player.index')->with('page_title', $title)->with('players', $user->players)->with('invites', $invites)->withUser($user);
}
示例14: feedGet
public function feedGet($page = 0, $key = null)
{
$limit = 20;
$offset = $page == 1 ? 0 : ($page - 1) * $limit;
$retVal = array('status' => 'ERR', 'msg' => 'Invalid Session');
try {
$user = \Member::where('sessionKey', '=', $key)->exists();
if (!$user) {
return Response::json($retVal);
}
//$media = \Media::where('status','approved')
//->where('createdDate','>', new DateTime() )
$media = \Media::orderBy('createdDate', 'desc')->take($limit)->get();
if ($media->count() > 0 && $user) {
//print_r($media);
$fmedia = $this->flattenMedia($media);
$retVal = $fmedia;
} else {
$retVal = array('status' => 'ERR', 'msg' => 'beyond your imagination :)');
}
return Response::json($retVal);
} catch (ModelNotFoundException $e) {
}
//return Response::json($retVal);
}
示例15: idMemberTable
public static function idMemberTable()
{
$membership_id = AppHelper::findMemberId();
$id_member_table = Member::where('membership_id', '=', $membership_id)->get();
foreach ($id_member_table as $id) {
$id = $id['id'];
}
$id = Member::find($id);
return $id->id;
}