當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Location::Where方法代碼示例

本文整理匯總了PHP中app\Location::Where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Location::Where方法的具體用法?PHP Location::Where怎麽用?PHP Location::Where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Location的用法示例。


在下文中一共展示了Location::Where方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAllResturantUsers

 public function getAllResturantUsers($id)
 {
     $users = User::Where('resturant_id', '=', $id)->Where('role_id', '=', 2)->get();
     $response = array();
     if (sizeof($users) > 0) {
         foreach ($users as $user) {
             $user_locations = UserLocation::Where('user_id', '=', $user['id'])->lists('location_id');
             $alluserlocation = Location::WhereIn('id', $user_locations)->get();
             $user_actions = UserAction::Where('user_id', '=', $user['id'])->first();
             array_push($response, ["user" => $user, "locations" => $alluserlocation, "mainmenu" => unserialize($user_actions['maincard']), "weeklymenu" => unserialize($user_actions['weeklymenu']), "items" => unserialize($user_actions['items'])]);
         }
         $allresturantlocations = Location::Where('resturantId', '=', $id)->get();
         return response()->json(["Response" => 'success', "data" => $response, "AllLocations" => $allresturantlocations]);
     }
     return response()->json(['Response' => 'error', 'message' => 'There was an error processing your request']);
 }
開發者ID:SohaibFarooqi,項目名稱:SubscriptionSystemBackend,代碼行數:16,代碼來源:UserController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($id)
 {
     //
     $franchises = Franchise::Where('resturantId', '=', $id)->get();
     $location = Location::Where('resturantId', '=', $id)->get();
     $response = array();
     if (sizeof($franchises) > 0) {
         foreach ($franchises as $franchise) {
             $user = User::Where('franchise_id', '=', $franchise['id'])->get();
             array_push($response, ["Franchise" => $franchise, "users" => $user]);
         }
         return response()->json(['Response' => 'success', 'data' => $response, 'locations' => $location]);
     } else {
         return response()->json(['Response' => 'error']);
     }
 }
開發者ID:SohaibFarooqi,項目名稱:SubscriptionSystemBackend,代碼行數:21,代碼來源:FranchiseController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id, $locationid)
 {
     //
     $allLocations = UserLocation::Where('location_id', '=', $locationid)->lists('user_id');
     UserAction::WhereIn('user_id', $allLocations)->delete();
     UserLocation::WhereIn('user_id', $allLocations)->delete();
     User::WhereIn('id', $allLocations)->delete();
     Location::Where('id', '=', $locationid)->delete();
     return response()->json(["Response" => "success", "message" => "Location Deleted"]);
 }
開發者ID:SohaibFarooqi,項目名稱:SubscriptionSystemBackend,代碼行數:16,代碼來源:LocationController.php


注:本文中的app\Location::Where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。