本文整理汇总了PHP中Registration::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::where方法的具体用法?PHP Registration::where怎么用?PHP Registration::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::where方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$friday = Registration::where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 6)->sum('tickets');
$saturday = Registration::where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 7)->sum('tickets');
$this->layout->with('subtitle', '');
$this->layout->content = View::make('home')->with('friday_registration_count', $friday)->with('saturday_registration_count', $saturday);
}
示例2: show
public function show($id)
{
$employee = Employee::findOrFail($id);
$registrations = Registration::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('employee_id', '=', $id)->orderBy('registration_date', 'desc')->get();
$earnings = Earning::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('employee_id', '=', $id)->get();
$retrievals = Retrieval::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('employee_id', '=', $id)->get();
$timelines = Timeline::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('informable_type', '=', 'Employee')->where('informable_id', '=', $id)->get();
$menu = 'employee';
return View::make('employees.show', compact('employee', 'registrations', 'earnings', 'retrievals', 'timelines', 'menu'));
}
示例3: loadEarnables
public function loadEarnables($issue_id)
{
$issue = Issue::find($issue_id);
$receivable = Receivable::with('installments_not_paid')->where('issue_id', '=', $issue_id)->first();
$registrations = Registration::where('student_id', '=', $issue->student_id)->where('cost_is_paid', '=', 0)->get();
$movements = Movement::where('issue_id', '=', $issue_id)->get();
$punishments = Punishment::where('issue_id', '=', $issue_id)->where('paid', '=', 0)->get();
$resigns = Resign::where('issue_id', '=', $issue_id)->where('is_earned', '=', 0)->get();
$responses = array('receivable' => $receivable, 'registrations' => $registrations, 'movements' => $movements, 'punishments' => $punishments, 'resigns' => $resigns);
return $responses;
}
示例4: create
public function create($issue_id)
{
$issue = Issue::find($issue_id);
$receivable = Receivable::with('installments')->where('issue_id', '=', $issue_id)->first();
$registration = Registration::where('student_id', '=', $issue->student_id)->where('cost_is_paid', '=', 0)->first();
$movements = Movement::where('issue_id', '=', $issue_id)->where('paid', '=', 0)->get();
$punishments = Punishment::where('issue_id', '=', $issue_id)->where('paid', '=', 0)->get();
$resigns = Resign::where('issue_id', '=', $issue_id)->where('fines', '>', 0.0)->where('is_earned', '=', 0)->get();
$employees = Employee::where('location_id', '=', Auth::user()->location_id)->get();
$menu = 'finance';
return View::make('earnings.create', compact('issue', 'receivable', 'registration', 'movements', 'punishments', 'resigns', 'employees', 'menu'));
}
示例5: showDashboard
public function showDashboard()
{
$menu = '';
$_301 = Issue::where('generation_id', '=', 1)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_201 = Issue::where('generation_id', '=', 2)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_101 = Issue::where('generation_id', '=', 3)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_302 = Issue::where('generation_id', '=', 4)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_202 = Issue::where('generation_id', '=', 5)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_102 = Issue::where('generation_id', '=', 6)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_603 = Issue::where('generation_id', '=', 7)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_503 = Issue::where('generation_id', '=', 8)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$_403 = Issue::where('generation_id', '=', 9)->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->count();
$last_month_registrations = Registration::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where(DB::raw('month(registration_date)'), '<>', date('m'))->where(DB::raw('year(registration_date)'), '=', date('Y'))->count();
$curr_month_registrations = Registration::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where(DB::raw('month(registration_date)'), '=', date('m'))->where(DB::raw('year(registration_date)'), '=', date('Y'))->count();
$movement_registrations = Registration::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('classification_id', '=', 10)->count();
$curr_active_students = Placement::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('active', '=', 1)->count();
$curr_do_students = Resign::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('classification_id', '=', 13)->count();
$curr_resign_students = Resign::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('classification_id', '=', 14)->count();
$curr_relocate_students = Resign::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('classification_id', '=', 15)->count();
$courses = Course::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->get();
return View::make('dashboard.home', compact('_301', '_201', '_101', '_302', '_202', '_102', '_603', '_503', '_403', 'last_month_registrations', 'curr_month_registrations', 'movement_registrations', 'curr_active_students', 'curr_do_students', 'curr_resign_students', 'curr_relocate_students', 'courses', 'menu'));
}
示例6: data
/**
* This function is responsible for all the data that is
* needed by different pages viaajax
*
* @return Depends on what what is being called
*/
public function data()
{
// BEGIN CHECK VEHICLE VIN
if (isset($_POST['vehicles_vin']) && $_POST['vehicles_vin'] != "") {
$vehicles_vin = $_POST['vehicles_vin'];
$vehicles_vin_status = Vehicle::where('vehicles_vin', $vehicles_vin)->withTrashed()->get()->count();
if ($vehicles_vin_status > 0) {
return 1;
}
}
// END CHECK VEHICLE VIN
// BEGIN CHECK VEHICLE LIC NO
if (isset($_POST['registrations_licence_plate_no']) && $_POST['registrations_licence_plate_no'] != "") {
$registrations_licence_plate_no = $_POST['registrations_licence_plate_no'];
$registrations_licence_plate_no_status = Registration::withTrashed()->where('registrations_licence_plate_no', $registrations_licence_plate_no)->get()->count();
if ($registrations_licence_plate_no_status > 0) {
return 1;
}
}
// END CHECK VEHICLE LIC NO
// BEGIN SHOW ALL MAKES (USER CLICKED ON YEAR)
if (isset($_POST['inp']) && $_POST['inp'] == 1) {
/* REMOVE TO SHOW ALL MODELS
$model_make_ar = ['-1' => 'Select Make'] + Model::distinct()->orderBy('model_make_id')->lists('model_make_id', 'model_make_id');
*/
$vehicles_year = $_POST['vehicles_year'];
$model_make_ar = ['-1' => 'Select Make'] + Model::where('model_year', $vehicles_year)->distinct()->orderBy('model_make_id')->lists('model_make_id', 'model_make_id');
$model_make_ar['add_new'] = "Add New";
foreach ($model_make_ar as $model_make_ar_fet) {
echo "<option value='{$model_make_ar_fet}'>{$model_make_ar_fet}</option>";
}
}
// END SHOW ALL MAKES (USER CLICKED ON YEAR)
// BEGIN SHOW ALL ASSOCIATED MODELS NAME AND TRIM (USER CLICKED ON MAKE)
if (isset($_POST['inp']) && $_POST['inp'] == 2) {
$vehicles_year = $_POST['vehicles_year'];
$vehicles_make_id = $_POST['vehicles_make_id'];
$vehicles_name_trim_arr = Model::where('model_year', $vehicles_year)->where('model_make_id', $vehicles_make_id)->get(['model_name', 'model_trim'])->toArray();
foreach ($vehicles_name_trim_arr as $vehicles_name_trim_arr_fet) {
$vehicles_name_trim[] = implode(', ', $vehicles_name_trim_arr_fet);
}
$vehicles_name_trim = array_unique($vehicles_name_trim);
sort($vehicles_name_trim);
$firstOp = "<option value='-1'>Select Model</option>";
echo $firstOp;
foreach ($vehicles_name_trim as $vehicles_name_trim_fet) {
echo "<option value='{$vehicles_name_trim_fet}'>{$vehicles_name_trim_fet}</option>";
}
}
// BEGIN SHOW ALL ASSOCIATED MODELS NAME AND TRIM (USER CLICKED ON MAKE)
// BEGIN SHOW ALL ASSOCIATED BODY STYLE (USER CLICKED ON MODEL)
if (isset($_POST['inp']) && $_POST['inp'] == 3) {
$vehicles_year = $_POST['vehicles_year'];
$vehicles_make_id = $_POST['vehicles_make_id'];
$vehicles_name_trim = $_POST['vehicles_name_trim'];
$vehicles_name_trim_ar = explode(',', $vehicles_name_trim);
$model_name = trim($vehicles_name_trim_ar[0]);
$model_trim = trim($vehicles_name_trim_ar[1]);
$vehicles_body_ar = array_filter(array_unique(Model::where('model_year', $vehicles_year)->where('model_make_id', $vehicles_make_id)->where('model_name', $model_name)->where('model_trim', $model_trim)->lists('model_body')));
sort($vehicles_body_ar);
$firstOp = "<option value='-1'>Select Body Style</option>";
echo $firstOp;
foreach ($vehicles_body_ar as $vehicles_body) {
echo "<option value='{$vehicles_body}'>{$vehicles_body}</option>";
}
}
// END SHOW ALL ASSOCIATED BODY STYLE (USER CLICKED ON MODEL)
// BEGIN SHOW ASSOCIATED BODY WEIGHT (USER CLICKED ON BODY STYLE)
// ALSO RESPONSIBLE FOR REPLYING TO AJAX REQUEST WHEN USER CLICKED ON MODEL
if (isset($_POST['inp']) && $_POST['inp'] == 4) {
$vehicles_year = $_POST['vehicles_year'];
$vehicles_make_id = $_POST['vehicles_make_id'];
$vehicles_name_trim = $_POST['vehicles_name_trim'];
$vehicles_name_trim_ar = explode(',', $vehicles_name_trim);
$model_name = trim($vehicles_name_trim_ar[0]);
$model_trim = trim($vehicles_name_trim_ar[1]);
// USER CLICKED ON MODEL
if (!isset($_POST['vehicles_body'])) {
$model_weight_kg_ar = array_filter(array_unique(Model::where('model_make_id', $vehicles_make_id)->where('model_name', $model_name)->where('model_trim', $model_trim)->where('model_year', $vehicles_year)->lists('model_weight_kg')));
if (!empty($model_weight_kg_ar)) {
sort($model_weight_kg_ar);
$firstOp = "<option value='-1'>Select Gross Weight</option>";
echo $firstOp;
foreach ($model_weight_kg_ar as $model_weight_kg_ar_fet) {
echo "<option value='{$model_weight_kg_ar_fet}'>{$model_weight_kg_ar_fet}</option>";
}
} else {
return 0;
}
} else {
$vehicles_body = $_POST['vehicles_body'];
$model_weight_kg_ar = array_filter(array_unique(Model::where('model_make_id', $vehicles_make_id)->where('model_name', $model_name)->where('model_trim', $model_trim)->where('model_body', $vehicles_body)->where('model_year', $vehicles_year)->lists('model_weight_kg')));
if (!empty($model_weight_kg_ar)) {
sort($model_weight_kg_ar);
//.........这里部分代码省略.........
示例7: function
<?php
View::composer(array('home', 'registrations.register'), function ($view) {
$all = Registration::get()->sum('tickets');
$today = Registration::where(DB::raw('DATE(registrations.created_at)'), DB::raw('CURDATE()'))->get()->sum('tickets');
$expected = Booking::get()->sum('tickets');
$view->with('registration_count_total', $all)->with('registration_count_today', $today)->with('expected_count', $expected);
});
示例8: ps
public function ps()
{
$teams = Registration::where('contest', '=', 'ps')->orderBy('university', 'ASC')->get();
return View::make('site.project_team')->with('teams', $teams)->with('title', 'IPvision SUST CSE Carnival 2015 ::. Team ::. Project Showcasing');
}
示例9: view_registration
public function view_registration($id)
{
$data = Registration::where('id', $id)->first();
return View::make('admin.registration.show', compact('data'));
}
示例10: recapCirculationPeriodic
public function recapCirculationPeriodic()
{
$registrations = Classification::where('category', '=', 'Registration')->get();
$resigns = Classification::where('category', '=', 'Resign')->get();
$periods = DB::table('registrations')->select(DB::raw('month(registration_date) as months'), DB::raw('year(registration_date) as years'))->groupBy(DB::raw('month(registration_date)'))->get();
$comes = array();
$leaves = array();
foreach ($registrations as $registration) {
$statistics = array();
foreach ($periods as $period) {
$count = Registration::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where(DB::raw('month(registration_date)'), '=', $period->months)->where(DB::raw('year(registration_date)'), '=', $period->years)->where('classification_id', '=', $registration->id)->count();
$statistics[] = array('count' => $count);
}
$comes[] = array('name' => $registration->name, 'statistics' => $statistics);
}
foreach ($resigns as $resign) {
$statistics = array();
foreach ($periods as $period) {
$count = Resign::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where(DB::raw('month(resign_date)'), '=', $period->months)->where(DB::raw('year(resign_date)'), '=', $period->years)->where('classification_id', '=', $resign->id)->count();
$statistics[] = array('count' => $count);
}
$leaves[] = array('name' => $resign->name, 'statistics' => $statistics);
}
$menu = 'report';
return View::make('reports.recapcirculationperiodic', compact('comes', 'leaves', 'periods', 'menu'));
}