本文整理汇总了PHP中Accounts::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Accounts::where方法的具体用法?PHP Accounts::where怎么用?PHP Accounts::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accounts
的用法示例。
在下文中一共展示了Accounts::where方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$manager_id = Session::get('manager_id');
$accounts = Accounts::where('manager_id', '=', $manager_id)->get();
return View::make('manager.accounts.index', ['accounts' => $accounts]);
}
示例2: Carbon
* TITLE: Главная страница
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php
$created = new Carbon(Config::get('site.date_over_action'));
$now = Carbon::now();
$difference = $created->diff($now)->days < 1 ? 'Сегодня заканчивается регистрация в конкурсе.' : 'До окончания регистрации в конкурсе осталось ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '.';
$created = new Carbon(Config::get('site.date_final_action'));
$now = Carbon::now();
$difference_final = $created->diff($now)->days < 1 ? 'Сегодня шоу-финал.' : 'До шоу-финала остается ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '. Зарегистрируйся на сайте и покажи свой талант всем!';
$map = array();
if (isset($page->blocks['map']['meta']['content']) && !empty($page->blocks['map']['meta']['content'])) {
$map = json_decode($page->blocks['map']['meta']['content'], TRUE);
}
$participants = Accounts::where('group_id', 4)->where('in_main_page', 1)->with('ulogin', 'likes')->take(15)->get();
foreach ($participants as $index => $participant) {
$participants[$index]['like_disabled'] = FALSE;
}
if (isset($_COOKIE['votes_list'])) {
$users_ids = json_decode($_COOKIE['votes_list']);
foreach ($participants as $index => $participant) {
if (in_array($participant->id, $users_ids)) {
$participants[$index]['like_disabled'] = TRUE;
}
}
}
?>
@extends(Helper::layout())
@section('style')
@stop
示例3: profileEdit
public function profileEdit()
{
$page_data = array('page_title' => 'Личный кабинет', 'page_description' => '', 'page_keywords' => '', 'profile' => Accounts::where('id', Auth::user()->id)->with('ulogin')->first());
return View::make(Helper::acclayout('profile'), $page_data);
}
示例4:
<?
/**
* TEMPLATE_IS_NOT_SETTABLE
*/
?>
<?php
$profile = Accounts::where('id', Auth::user()->id)->with('ulogin')->first();
?>
@extends(Helper::layout())
@section('style')
@stop
@section('page_class') @stop
@section('content')
<div class="main-content sub-page">
<div class="block">
<div class="content">
<div class="participate-block">
<h2>Редактирование профиля</h2>
<div class="forms-holder full-registration-holder">
@include(Helper::acclayout('forms.profile'))
</div>
@include(Helper::layout('forms.valid-phone'))
</div>
</div>
</div>
</div>
@stop
@section('scripts')
@stop
示例5: participantsListsImport
public function participantsListsImport($params)
{
$filter_status = Input::get('filter_status');
$users_list = Accounts::where('group_id', 4);
if (Input::has('without_video')) {
$users_list = $users_list->where('video', '');
}
if ($filter_status >= 0) {
$users_list = $users_list->where('status', $filter_status);
}
$users_list = $users_list->orderBy('created_at', 'DESC')->get();
$users = $fields = array();
$output = '';
foreach ($users_list as $user) {
$fio = explode(' ', $user->name);
$name = iconv("UTF-8", Input::get('coding'), @$fio[0]);
$surname = iconv("UTF-8", Input::get('coding'), @$fio[1]);
$glue = Input::get('glue');
$field = Input::get('field');
if ($field == 'all') {
$fields = array($user->email, $user->phone, $user->photo, $name, $surname);
} elseif ($field == 'email') {
$fields = array($user->email, $name, $surname);
} elseif ($field == 'phone') {
$fields = array($user->phone, $name, $surname);
}
if ($params == 'all') {
if ($glue === 'tab') {
$output .= implode("\t", $fields) . "\n";
} else {
$output .= implode("{$glue}", $fields) . "\n";
}
} else {
if ($glue === 'tab') {
$output .= implode("\t", $fields) . "\n";
} else {
$output .= implode("{$glue}", $fields) . "\n";
}
}
}
$headers = array('Content-Type' => 'text/csv', 'Content-Disposition' => 'attachment; filename="ExportList.csv"');
return Response::make(rtrim($output, "\n"), 200, $headers);
}
示例6: Carbon
<?
/**
* TEMPLATE_IS_NOT_SETTABLE
*/
?>
<?php
$profile = Accounts::where('id', Auth::user()->id)->with('ulogin', 'codes', 'prizes', 'writing')->first();
$bdate = new Carbon($profile->bdate);
$now = Carbon::now();
$post['customerId'] = Auth::user()->remote_id;
$post['sessionKey'] = Auth::user()->sessionKey;
$prizes = (new ApiController())->get_prizes($post);
if (count($prizes) > 1) {
if (isset($prizes['LinguaLeo.LotteryTicket']) && empty($prizes['LinguaLeo.LotteryTicket']['certificateCode'])) {
Config::set('api.wonLotteryTicketId', $prizes['LinguaLeo.LotteryTicket']['customerPrize_id']);
}
foreach ($prizes as $systemName => $prize) {
if ($systemName !== 'LiptonLinguaLeoForTravellers') {
$second_prize = $prize;
}
}
}
?>
@extends(Helper::layout())
@section('title')
Личный кабинет
@stop
@section('style')
@stop
@section('page_class') @stop
@section('content')
示例7: setLike
public function setLike($user_id)
{
$json_request = array('status' => FALSE, 'count' => 0);
if (Request::ajax()) {
if ($user = Accounts::where('group_id', 4)->where('id', $user_id)->first()) {
self::incrementLikePost($user);
$json_request['status'] = TRUE;
$json_request['count'] = ParticipantLikes::where('participant_id', $user_id)->count() + Accounts::where('id', $user_id)->pluck('guest_likes');
}
} else {
return Redirect::back();
}
return Response::json($json_request, 200);
}
示例8: participantsLikes
public function participantsLikes()
{
$validator = Validator::make(Input::all(), array('begin' => 'required', 'end' => 'required'));
if ($validator->passes()) {
$api = new ApiController();
$begin = (new myDateTime())->setDateString(Input::get('begin'))->format('Y-m-d 00:00:00');
$end = (new myDateTime())->setDateString(Input::get('end'))->format('Y-m-d 23:59:59');
foreach (Accounts::where('group_id', 4)->where('created_at', '>=', $begin)->where('created_at', '<=', $end)->with('writing')->get() as $user) {
if (!empty($user->writing) && !empty($user->writing->writing)) {
$post['url'] = URL::route('show.participant.writing', $user->writing->id . '-' . BaseController::stringTranslite($user->name . '-' . $user->surname));
$likes = $api->social_likes($post);
$user->total_extend = $likes['extend'];
$user->total_likes = $likes['total'];
$user->save();
}
}
}
return Redirect::back();
}
示例9: foreach
<?
/**
* TITLE: Участники
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php
$participants = Accounts::where('group_id', 4)->orderBy('created_at', 'DESC')->with('ulogin', 'likes')->paginate(25);
foreach ($participants as $index => $participant) {
$participants[$index]['like_disabled'] = FALSE;
}
if (isset($_COOKIE['votes_list'])) {
$users_ids = json_decode($_COOKIE['votes_list']);
foreach ($participants as $index => $participant) {
if (in_array($participant->id, $users_ids)) {
$participants[$index]['like_disabled'] = TRUE;
}
}
}
?>
@extends(Helper::layout())
@section('style')
@stop
@section('page_class')sticky participants
@stop
@section('content')
<main>
<section class="long color-blue video"
style="background-image: url('{{ asset(Config::get('site.theme_path')) }}/img/tmp-visual-13.jpg')">
<iframe data-src="https://player.vimeo.com/video/136314283?autoplay=1&loop=1&color=ffffff&title=0&byline=0&portrait=0"
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>