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


PHP Room::where方法代码示例

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


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

示例1: isUnique

 /**
  * make shure the username is valid for this room
  *
  * @param $newName string
  * @param $roomName string
  * @return bool
  */
 public function isUnique($newName, $roomName)
 {
     $room = Room::where('name', '=', $roomName)->first();
     $count = User::where('room_id', '=', $room->id)->where('connected', '=', 1)->where('name', '=', $newName)->count();
     $this->validationErrors->add('name', 'This name has already been taken :(');
     return $count === 0 ? true : false;
 }
开发者ID:brucewu16899,项目名称:whatup,代码行数:14,代码来源:User.php

示例2: getEdit

 /**
  * Show the form for editing the specified room.
  *
  * @param  int $id
  * @return Response
  */
 public function getEdit($id)
 {
     $room = Room::find($id);
     $rooms = Room::where('property_id', Property::getLoggedId())->where('type', '<>', 'plan')->where('id', '<>', $id)->lists('name', 'id');
     $formulaTypes = Room::$formulaTypes;
     return View::make('rooms.edit', compact('room', 'formulaTypes', 'rooms'));
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:13,代码来源:RoomsController.php

示例3: subscribe

 public function subscribe($connection, $topic, $room_name = null)
 {
     //check if room exists
     if ($room = Room::where('name', '=', $room_name)->first()) {
         //save current room to database
         $user = $room->users()->save($connection->WhatUp->user);
         //save user to $rooms array so we have an easy accessible collection
         //of all currently connected users
         $this->rooms[$room_name][$user->session_id] = $user;
         //save current topic a.k.a room and this instance to the conneciton
         $connection->WhatUp->currentRoom = $topic;
         $connection->WhatUp->handler = $this;
         //broadcast that a new user is joined to other subscribers of this room
         $msg = array('action' => 'newUser', 'user' => $user->toJson(), 'msg' => 'User ' . $user->name . ' joined.');
         $this->broadcast($topic, $msg, $exclude = array($user->session_id));
         //list all currently connected subscribers to the new guy
         foreach ($this->rooms[$room_name] as $subscriber) {
             if ($subscriber->session_id != $user->session_id) {
                 $msg = array('action' => 'newUser', 'user' => $subscriber->toJson());
                 $this->broadcast($topic, $msg, $exclude = array(), $eligible = array($user->session_id));
             }
         }
     } else {
         //room does not exist
         $connection->close();
     }
 }
开发者ID:brucewu16899,项目名称:whatup,代码行数:27,代码来源:RoomTopic.php

示例4: editEvent

 public function editEvent($id)
 {
     $rooms = Room::where('id', '>', 0)->get();
     View::share('rooms', $rooms);
     $squeeb = Lecture::where('id', '=', $id)->first();
     View::share('squeeb', $squeeb);
     return View::make('organiser.edit');
 }
开发者ID:franqq,项目名称:plmas,代码行数:8,代码来源:PostLectureController.php

示例5: rooms

 public function rooms()
 {
     Mate::where('created_at', '<', date('Y-m-d H:i:s', strtotime('-1 day')))->delete();
     Room::where('created_at', '<', date('Y-m-d H:i:s', strtotime('-1 day')))->delete();
     Room::where('created_at', '<', date('Y-m-d H:i:s', strtotime('-1 hour')))->where('state', 'LIKE', 'end%')->delete();
     $rooms = Room::orderBy('created_at', 'DESC')->paginate();
     return View::make('prepare.rooms', ['rooms' => $rooms]);
 }
开发者ID:asdoda,项目名称:wolfer,代码行数:8,代码来源:PrepareController.php

示例6: get_index

 public function get_index($city = null)
 {
     $inputs = array('pmin' => Input::get('pmin'), 'pmax' => Input::get('pmax'), 'smin' => Input::get('smin'), 'smax' => Input::get('smax'), 'smoking' => Input::get('smoking'), 'pets' => Input::get('pets'), 'toilet' => Input::get('toilet'), 'shower' => Input::get('shower'), 'kitchen' => Input::get('kitchen'), 'order' => Input::get('order'));
     if (!is_null($city)) {
         $inputs['city'] = str_replace('-', ' ', $city);
     } else {
         $inputs['city'] = Input::get('city');
     }
     $rules = array('city' => 'exists:photos, city');
     $v = Validator::make($inputs['city'], $rules);
     $query = Room::where('status', '=', 'publish');
     if (!empty($inputs['city'])) {
         $city = $inputs['city'];
         $query->where(function ($query) use($city) {
             $query->where('city', 'LIKE', '%' . $city . '%');
             $query->or_where('description', 'LIKE', '%' . $city . '%');
             $query->or_where('title', 'LIKE', '%' . $city . '%');
         });
     }
     if (!empty($inputs['pmin']) && !empty($inputs['pmax'])) {
         $query->where('price', '>', $inputs['pmin']);
         $query->where('price', '<', $inputs['pmax']);
     }
     if (!empty($inputs['smin']) && !empty($inputs['smax'])) {
         $query->where('surface', '>', $inputs['smin']);
         $query->where('surface', '<', $inputs['smax']);
     }
     if (!empty($inputs['smoking'])) {
         $query->where('smoking', '=', $inputs['smoking']);
     }
     if (!empty($inputs['pets'])) {
         $query->where('pets', '=', $inputs['pets']);
     }
     if (!empty($inputs['toilet'])) {
         $query->where('toilet', '=', $inputs['toilet']);
     }
     if (!empty($inputs['shower'])) {
         $query->where('shower', '=', $inputs['shower']);
     }
     if (!empty($inputs['kitchen'])) {
         $query->where('kitchen', '=', $inputs['kitchen']);
     }
     if (!empty($inputs['order']) && $inputs['order'] == 'price' || $inputs['order'] == 'created_at') {
         $query->order_by($inputs['order'], 'desc');
     } else {
         $query->order_by("created_at", 'desc');
     }
     $total = $query->get();
     $rooms = $query->paginate(Room::$per_page);
     Input::flash();
     if (!$v->fails()) {
         $bgphoto = Photo::where('city', '=', $inputs['city'])->first();
         return View::make('home.search')->with('total', $total)->with('bgphoto', $bgphoto)->with('city', $city)->with('rooms', $rooms);
     } else {
         return View::make('home.search')->with('total', $total)->with('rooms', $rooms);
     }
 }
开发者ID:sanneterpstra,项目名称:Kamergenood,代码行数:57,代码来源:search.php

示例7: get_rooms

 public function get_rooms()
 {
     $query = Room::where('status', '=', 'publish');
     if (isset($_GET['order']) && isset($_GET['by'])) {
         $query->order_by($_GET['by'], $_GET['order']);
     }
     $query->order_by('created_at', 'desc');
     $rooms = $query->paginate(Room::$per_page);
     return View::make('admin.rooms.index')->with('rooms', $rooms);
 }
开发者ID:sanneterpstra,项目名称:Kamergenood,代码行数:10,代码来源:admin.php

示例8: getIndex

 public function getIndex()
 {
     $key = Input::get('search');
     if (isset($key)) {
         $data = Room::where('name', 'like', '%' . $key . '%')->orderBy('id', 'desc')->paginate(10);
     } else {
         $data = Room::orderBy('id', 'desc')->paginate(10);
     }
     return View::make('home/dashboard', array())->nest('content', 'room/index', array('data' => $data));
 }
开发者ID:andrinda,项目名称:myhotel,代码行数:10,代码来源:RoomsController.php

示例9: update

 public function update($id, Request $request)
 {
     $room = Room::where('id', '=', $id)->firstOrFail();
     $room->update($request->all());
     if (Input::file('img')) {
         $image = Input::file('img');
         $destinationPath = public_path() . '/room/' . $thisObject->id . '/';
         $filename = $image->getClientOriginalName();
         $image->move($destinationPath, $filename);
     }
     return redirect('rooms');
 }
开发者ID:RetinaInc,项目名称:Booking-application,代码行数:12,代码来源:RoomsController.php

示例10: createRoom

 public function createRoom($buildingid)
 {
     //count position
     $position = count(Room::where('building_id', '=', $buildingid)->get()) + 1;
     $room = new Room();
     $room->name = Input::get("roomname");
     $room->position = $position;
     $room->building_id = $buildingid;
     $room->save();
     //fetch created id
     $id = $room->id;
     return Redirect::to('/building/' . $buildingid . '/' . $id);
 }
开发者ID:axelardu,项目名称:festic-partner,代码行数:13,代码来源:DesignerController.php

示例11: update

 public function update(Request $request, $id)
 {
     $client = Client::where('id', $id)->first();
     $client->surname = $request->input('surname');
     $client->name = $request->input('name');
     $client->age = $request->input('age');
     $client->room_id = $request->input('room_id');
     $client->save();
     $room = $request->input('room_id');
     $false = Room::where('id', $room)->first();
     $false->free = 0;
     $false->save();
     return $client;
 }
开发者ID:Agufarre,项目名称:php-bootcamp,代码行数:14,代码来源:controller_clients.php

示例12: filterTransaction

 public function filterTransaction()
 {
     $rType = Input::get('rType');
     $sType = Input::get('sType');
     $response = array();
     if (empty($sType) && !empty($rType)) {
         $transactions = CottageReservation::where('reservation_type', '=', $rType)->get();
     } elseif (!empty($sType) && !empty($rType)) {
         $transactions = CottageReservation::where('reservation_type', '=', $rType)->where('status', '=', $sType)->get();
     } else {
         $transactions = CottageReservation::where('status', '=', $sType)->get();
     }
     foreach ($transactions as $transaction) {
         $roomname = Room::where('rnid', '=', $transaction['room_id'])->first();
         $userInfo = UserInfo::where('user_id', '=', $transaction['user_id'])->first();
         $reservation_type = ReservationType::find($transaction['reservation_type'])->first();
         if ($transaction['reservation_type'] == "1") {
             if ($transaction['day_type'] == 1) {
                 $time = "Morning";
             } else {
                 $time = "Overnight";
             }
         } else {
             $time = date("g:i a", strtotime($transaction['check_in_datetime']));
         }
         //cottage list
         /*
                     $cottagelists = explode(",", $transaction['cottagelist_id']);
                     foreach($cottagelists as $list)
                     {
                     	$cottagename = CottageList::where('cottagelist_id','=',$list)->first();
                     	
                     	
                     	
                     	if(!in_array($cottagename['cottagename'], $cottagelists))
         				{
         					$a[count($cottagelists)] = $cottagename['cottagename'];
         				}
                     }*/
         $all = CottageList::all();
         $cottagelists = explode(",", $transaction['cottagelist_id']);
         $cottagelists2 = array();
         foreach ($all as $cottagename) {
             if (in_array($cottagename['cottagelist_id'], $cottagelists)) {
                 $cottagelists2[count($cottagelists2)] = $cottagename['cottagename'] . "<br>";
             }
         }
         $a = $cottagelists2;
         $response[] = array("id" => $transaction['id'], "fname" => $userInfo['firstname'], "lname" => $userInfo['lastname'], "rtpe" => $reservation_type['name'], "rdate" => $transaction['reservation_date'], "status" => $transaction['status'], "room_name" => !empty($roomname) ? $roomname['roomname'] : "", "cottage_name" => $a, "ttime" => $time);
     }
     return $response;
 }
开发者ID:jhunel2389,项目名称:baeyaya-dev,代码行数:52,代码来源:FileMaintenanceController.php

示例13: clientBookingStep2

 public function clientBookingStep2()
 {
     $i = Input::all();
     $x = [];
     $room_reservation['reservation_room'] = [];
     $i['checkin'] = Session::get('reservation.checkin') . ' 12:00:00';
     $i['checkout'] = Session::get('reservation.checkout') . ' 11:59:00';
     $room_reservation['checkin'] = Session::get('reservation.checkin') . ' 12:00:00';
     $room_reservation['checkout'] = Session::get('reservation.checkout') . ' 11:59:00';
     $room_reservation['display_checkout'] = Session::get('reservation.display_checkout');
     foreach ($i['rooms'] as $r) {
         if ($r['quantity'] > 0) {
             array_push($room_reservation['reservation_room'], $r);
         }
     }
     $count = 0;
     $rooms = [];
     foreach ($room_reservation['reservation_room'] as $room) {
         $count++;
         $r = Room::where('id', $room['room_id'])->select('id', 'name', 'price')->first();
         $room_reservation['reservation_room'][$count - 1]['room_details'] = $r;
         array_push($rooms, $r);
     }
     Session::put('reservation', $room_reservation);
     foreach (Session::get('reservation')['reservation_room'] as $rooms) {
         $count++;
         $room_id = $rooms['room_details']['id'];
         $available_rooms = [];
         $room_qty = RoomQty::with(array('roomPrice', 'roomReserved' => function ($query) use($i, $room_id) {
             $query->where(function ($query2) use($i, $room_id) {
                 $query2->whereBetween('check_in', array($i['checkin'], $i['checkout']))->orWhereBetween('check_out', array($i['checkin'], $i['checkout']))->orWhereRaw('"' . $i["checkin"] . '" between check_in and check_out')->orWhereRaw('"' . $i["checkout"] . '" between check_in and check_out');
             })->where(function ($query3) {
                 $query3->where('status', '!=', 5)->where('status', '!=', 3);
             });
         }))->where('room_id', $room_id)->where('status', 1)->get();
         foreach ($room_qty as $available) {
             if ($available->roomReserved == '[]' || count($available->roomReserved) == 0) {
                 array_push($available_rooms, $available);
             }
         }
         if (count($available_rooms) < $rooms['quantity']) {
             return Redirect::to('booking/step2')->with('error', 'Some rooms you booked is not available');
         }
     }
     return Redirect::to('booking/step3');
 }
开发者ID:jonathanespanol,项目名称:FiligansHotelReservation,代码行数:46,代码来源:BookingController.php

示例14: function

    //this will output the second layout
});
Route::get('testpaypal', 'PaypalController@prepareExpressCheckout');
Route::get('room1', function () {
    $cpage = 'room';
    return View::make('clientview.room', compact('cpage'));
});
Route::post('reservation/proceed', function () {
    $i = Input::all();
    Session::put('checkin', $i['checkin']);
    Session::put('checkout', $i['checkout']);
    Session::put('reserved_room_id', $i['id']);
    return $i;
});
Route::get('room/{id}', function ($id) {
    $room = Room::where('id', $id)->with('roomQty', 'roomImages.photo')->first();
    $cpage = 'room';
    if (!empty($room)) {
        return View::make('clientview2.room.show', compact('room', 'cpage'));
    }
    return Redirect::to('room');
});
Route::post('room/{id}/availability', function ($id) {
    $i = Input::all();
    $i['checkin'] = date('Y-m-d 12:00:00', strtotime($i['checkin']));
    $i['checkout'] = date('Y-m-d 11:59:59', strtotime('+' . $i['nights'] . ' day', strtotime($i['checkin'])));
    $available_rooms = 0;
    $room1 = [];
    //$roomDetails = Room::where('id')->first();
    $room = RoomQty::where('room_id', $id)->with(array('roomReserved' => function ($query) use($id, $i) {
        $query->where(function ($query2) use($id, $i) {
开发者ID:jonathanespanol,项目名称:FiligansHotelReservation,代码行数:31,代码来源:routes.php

示例15: if

	}else if(!isset($_SESSION['step_02_completed']) || $_SESSION['step_02_completed'] != true){
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-02'));
	}else if(!isset($_SESSION['step_03_completed']) || $_SESSION['step_03_completed'] != true){
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-03'));
	}else if(!isset($_SESSION['step_04_completed']) || $_SESSION['step_04_completed'] != true){
		die(header('Location: ' . DOMAIN . 'dashboard/add-hotel/step-04'));
	}

	if(isset($_SESSION['hotel_step_error']) && (strlen($_SESSION['hotel_step_error']) > 0)){
?>
<div><?php echo $_SESSION['hotel_step_error']; $_SESSION['hotel_step_error'] = ''; ?></div>
<?php } ?>
<?php
	$hotel_id = isset($_SESSION['editing_hotel']) ? $_SESSION['editing_hotel'] : -1;
	$room = new Room();
	$roomTypes = $room->where('hotel_id', '=', $hotel_id)
		->join('room_types', 'rooms.room_type_id', '=', 'room_types.id')
		->select('rooms.*', 'room_types.name as room_type_name', 'room_types.id as room_type_id')
		->get();
?>
<form action="<?php echo HTTP; ?>dashboard/get_step_06.php" method="post">
	<input type="hidden" value="ec14f83d70784a0c311a09533c9f9a23" name="csrf"/>
	<fieldset>
		<legend>Hotel Registration/Property-details</legend>
		<h3 class="h3">Assign rooms</h3>

		<table class="table table-bordered">
			<thead>
				<tr>
					<th>Room type</th>
					<th>Assigned quantity</th>
开发者ID:jcodesdotme,项目名称:pp,代码行数:31,代码来源:step_06.php


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