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


PHP Self::getVendorLocationCuisine方法代码示例

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


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

示例1: getALaCarteDetails

 /**
  * Reads the details of the LaCarte matching the
  * passed name.
  * 
  * @access	public
  * @param	string	$laCarte
  * @return	array
  * @since	1.0.0
  * @version	1.0.0
  */
 public static function getALaCarteDetails($aLaCarteID)
 {
     if (!is_numeric($aLaCarteID)) {
         $query = DB::table('vendor_locations')->where('slug', $aLaCarteID)->select('id')->first();
         if ($query) {
             $aLaCarteID = $query->id;
         } else {
             $arrData['status'] = Config::get('constants.API_SUCCESS');
             $arrData['no_result_msg'] = 'No matching values found.';
             $arrData['data'] = array();
             $arrData['total_count'] = 0;
             return $arrDatas;
         }
     }
     //Checking the bookmark status of the product
     $data['access_token'] = $_SERVER['HTTP_X_WOW_TOKEN'];
     $userID = UserDevices::getUserDetailsByAccessToken($data['access_token']);
     $bookmark = DB::table('user_bookmarks as ub')->where('user_id', '=', $userID)->where('vendor_location_id', '=', $aLaCarteID)->select('id', 'type')->first();
     //array to store the matching result
     $arrData = array();
     //query to read the details of the A-La-Carte
     $queryResult = DB::table(DB::raw('vendor_locations as vl'))->join('vendors', 'vendors.id', '=', 'vl.vendor_id')->join(DB::raw('vendor_location_attributes_text as vlat'), 'vlat.vendor_location_id', '=', 'vl.id')->join(DB::raw('vendor_attributes as va'), 'va.id', '=', 'vlat.vendor_attribute_id')->leftjoin(DB::raw('vendor_locations_curator_map as vlcm'), 'vlcm.vendor_location_id', '=', 'vl.id')->leftjoin('curators', 'curators.id', '=', 'vlcm.curator_id')->join(DB::raw('vendor_location_address as vla'), 'vla.vendor_location_id', '=', 'vl.id')->join(DB::raw('locations as loc1'), 'loc1.id', '=', 'vla.area_id')->join(DB::raw('locations as loc2'), 'loc2.id', '=', 'vla.city_id')->join(DB::raw('locations as loc3'), 'loc3.id', '=', 'vla.state_id')->join(DB::raw('locations as loc4'), 'loc4.id', '=', 'vla.country_id')->join('locations as loc5', 'loc5.id', '=', 'vl.location_id')->leftJoin(DB::raw('media_resized_new as m2'), 'm2.id', '=', 'curators.media_id')->leftJoin(DB::raw('vendor_location_attributes_integer as vlai'), 'vlai.vendor_location_id', '=', 'vl.id')->leftJoin(DB::raw('vendor_attributes as va2'), 'va2.id', '=', 'vlai.vendor_attribute_id')->where('vl.id', $aLaCarteID)->where('vl.a_la_carte', '=', 1)->where('vl.status', 'Active')->where('va2.alias', 'reward_points_per_reservation')->groupBy('vl.id')->select('vl.id as vl_id', 'vl.vendor_id', 'vla.address', 'vla.pin_code', 'vla.latitude', 'vla.longitude', 'vendors.name as title', DB::raw('MAX(IF(va.alias = "restaurant_info", vlat.attribute_value, "")) AS resturant_info'), DB::raw('MAX(IF(va.alias = "short_description", vlat.attribute_value, "")) AS short_description'), DB::raw('MAX(IF(va.alias = "terms_and_conditions", vlat.attribute_value, "")) AS terms_conditions'), DB::raw('MAX(IF(va.alias = "menu_picks", vlat.attribute_value, "")) AS menu_picks'), DB::raw('MAX(IF(va.alias = "expert_tips", vlat.attribute_value, "")) AS expert_tips'), DB::raw('MAX(IF(va.alias = "special_offer_title", vlat.attribute_value, "")) AS special_offer_title'), DB::raw('MAX(IF(va.alias = "special_offer_desc", vlat.attribute_value, "")) AS special_offer_desc'), 'loc1.name as area', 'loc1.id as area_id', 'loc2.name as city', 'loc3.name as state_name', 'loc4.name as country', 'loc5.name as locality', 'curators.name as curator_name', 'curators.bio as curator_bio', 'curators.designation as designation', 'vl.pricing_level', 'vlai.attribute_value as reward_point', 'm2.file as curator_image', 'vl.location_id as vl_location_id', 'vlcm.curator_tips', 'vla.city_id', 'vl.slug')->first();
     if ($queryResult) {
         //reading the review ratings
         $arrReview = Review::findRatingByVendorLocation(array($queryResult->vl_id));
         //reading vendor-cuisine
         $arrVendorCuisine = Self::getVendorLocationCuisine(array($queryResult->vl_id));
         //reading the similar vendors
         $arrSimilarVendor = Self::getSimilarALaCarte(array('location_id' => $queryResult->area_id, 'pricing_level' => $queryResult->pricing_level, 'city_id' => $queryResult->city_id));
         $arrSimilarAlacarteFilters = $arrSimilarVendor;
         //print_r($filters); die("hmm");
         $arrResultAlacarte = Self::fetchListings($arrSimilarAlacarteFilters);
         //print_r($arrResult); die("hmm");
         //initializing the values for experience
         if (Self::isExperienceAvailable($queryResult->vl_id)) {
             $experienceAvailable = 'true';
             $experienceURL = URL::to('/') . '/experience/' . $aLaCarteID;
         } else {
             $experienceAvailable = 'false';
             $experienceURL = '';
         }
         //getting the images
         $arrImage = self::getVendorImages($queryResult->vl_id);
         //formatting the array for the data
         $arrData['data'] = array('type' => 'A-La-Carte Details', 'id' => $queryResult->vl_id, 'title' => $queryResult->title, 'resturant_information' => empty($queryResult->resturant_info) ? "" : $queryResult->resturant_info, 'short_description' => empty($queryResult->short_description) ? "" : $queryResult->short_description, 'terms_and_condition' => empty($queryResult->terms_conditions) ? "" : $queryResult->terms_conditions, 'special_offer_title' => empty($queryResult->special_offer_title) ? "" : $queryResult->special_offer_title, 'special_offer_desc' => empty($queryResult->special_offer_desc) ? "" : $queryResult->special_offer_desc, 'pricing' => $queryResult->pricing_level, 'image' => $arrImage, 'rating' => array_key_exists($queryResult->vl_id, $arrReview) ? $arrReview[$queryResult->vl_id]['averageRating'] : 0, 'review_count' => array_key_exists($queryResult->vl_id, $arrReview) ? $arrReview[$queryResult->vl_id]['totalRating'] : 0, 'cuisine' => array_key_exists($queryResult->vl_id, $arrVendorCuisine) ? $arrVendorCuisine[$queryResult->vl_id] : array(), 'experience_available' => $experienceAvailable, 'experience_url' => $experienceURL, 'location_address' => array("address_line" => $queryResult->address, "locality" => $queryResult->locality, "area" => $queryResult->area, "city" => $queryResult->city, "pincode" => $queryResult->pin_code, "state" => $queryResult->state_name, "country" => $queryResult->country, "latitude" => $queryResult->latitude, "longitude" => $queryResult->longitude), 'curator_information' => array('curator_name' => is_null($queryResult->curator_name) ? "" : $queryResult->curator_name, 'curator_bio' => is_null($queryResult->curator_bio) ? "" : $queryResult->curator_bio, 'curator_image' => is_null($queryResult->curator_image) ? "" : Config::get('constants.API_MOBILE_IMAGE_URL') . $queryResult->curator_image, 'curator_designation' => is_null($queryResult->designation) ? "" : $queryResult->designation, 'suggestions' => is_null($queryResult->curator_tips) ? "" : $queryResult->curator_tips), 'menu_pick' => is_null($queryResult->menu_picks) ? "" : $queryResult->menu_picks, 'similar_option' => $arrSimilarAlacarteFilters, 'similar_option' => $arrResultAlacarte, 'reward_point' => is_null($queryResult->reward_point) ? 0 : $queryResult->reward_point, 'expert_tips' => is_null($queryResult->expert_tips) ? "" : $queryResult->expert_tips, 'slug' => $queryResult->slug, 'bookmark_status' => is_null($bookmark) ? 0 : 1);
         //reading the review details
         $arrData['data']['review_detail'] = Review::getVendorLocationRatingDetails($queryResult->vl_id);
         //reading the locations
         $arrData['data']['other_location'] = self::getVendorLocation($queryResult->vendor_id, $queryResult->vl_location_id);
         //setting the value of status
         $arrData['status'] = Config::get('constants.API_SUCCESS');
     } else {
         $arrData['status'] = Config::get('constants.API_ERROR');
         $arrData['no_result_msg'] = 'No matching values found.';
     }
     return $arrData;
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:67,代码来源:ALaCarte.php

示例2: getSimilarALaCarte

 /**
  * Returns the aLacarte details matching the passed
  * parameters.
  *
  * @static  true
  * @access  public
  * @param   array $arrData
  * @since   1.0.0
  */
 public static function getSimilarALaCarte($arrData)
 {
     $strQuery = DB::table(DB::raw('vendor_locations as vl'))->join('vendors', 'vendors.id', '=', 'vl.vendor_id')->join(DB::raw('locations as loc'), 'loc.id', '=', 'vl.location_id')->join(DB::raw('vendor_media_map as vmm'), 'vmm.vendor_id', '=', 'vendors.id')->leftJoin('media', 'media.id', '=', 'vmm.media_id')->where('vl.a_la_carte', '=', 1)->where('vmm.media_type', '=', 'listing')->where('loc.id', '=', $arrData['location_id']);
     //adding filter info
     if ($arrData['pricing_level'] == "High") {
         $strQuery->where('vl.pricing_level', 'High')->where('vl.pricing_level', 'Medium')->where('vl.pricing_level', 'Low');
     } elseif ($arrData['pricing_level'] == "Medium") {
         $strQuery->where('vl.pricing_level', 'Medium')->where('vl.pricing_level', 'Low');
     } else {
         $strQuery->where('vl.pricing_level', 'Low');
     }
     #executing the query
     $queryResult = $strQuery->select('vl.id', 'vendors.name', 'vl.pricing_level', DB::raw('loc.name as location_name,vl.slug as vendor_slug'))->get();
     //array to hold the vendors information
     $arrVendorInformation = array();
     //array to hold the vendor ids
     $arrVendorId = array();
     //array to hold vendor reviews
     $arrReview = array();
     //array to hold vendor cuisines
     $arrVendorCuisine = array();
     if ($queryResult) {
         foreach ($queryResult as $row) {
             $arrVendorId[] = $row->id;
         }
         //getting vendors review details
         $arrReview = Self::findRatingByVendorLocation($arrVendorId);
         //getting vendors available cuisine
         $arrVendorCuisine = Self::getVendorLocationCuisine($arrVendorId);
         foreach ($queryResult as $row) {
             $arrVendorInformation = array('id' => $row->id, 'title' => $row->title, 'rating' => array_key_exists($row->vl_id, $arrReview) ? $arrReview[$row->vl_id]['averageRating'] : 0, 'review_count' => array_key_exists($row->vl_id, $arrReview) ? $arrReview[$row->vl_id]['totalRating'] : 0, 'pricing_level' => $row->pricing_level, 'location' => $row->location_name, 'url' => URL::to('/') . $row->vendor_location_slug, 'image' => "", 'cuisine' => array_key_exists($row->id, $arrVendorCuisine) ? $arrVendorCuisine[$row->id] : array());
         }
     }
     return $arrVendorInformation;
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:44,代码来源:AlacarteModel.php


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