当前位置: 首页>>代码示例>>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;未经允许,请勿转载。