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


PHP Self::getProductLocations方法代码示例

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


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

示例1: find

 /**
  * Returns the details of the experience
  * matching the passed id.
  * 
  * @access	public
  * @param	integer		$experienceID
  * @since	1.0.0
  * @version	1.0.0
  */
 public function find($experienceID)
 {
     if (!is_numeric($experienceID)) {
         $query = DB::table('products')->where('slug', $experienceID)->select('id')->first();
         if ($query) {
             $experienceID = $query->id;
         } else {
             $arrExpDetails['status'] = Config::get('constants.API_SUCCESS');
             $arrExpDetails['no_result_msg'] = 'No matching values found.';
             $arrExpDetails['data'] = array();
             $arrExpDetails['total_count'] = 0;
             return $arrExpDetails;
         }
     }
     //query to read product type
     $queryType = DB::table('products')->where('id', $experienceID)->select('name', 'type')->first();
     //print_r($queryType); die();
     //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('product_id', '=', $experienceID)->select('id', 'type')->first();
     //query to read the experience detail
     $queryExperience = DB::table('products')->leftJoin('product_attributes_text as pat', 'pat.product_id', '=', 'products.id')->leftJoin('product_attributes as pa', 'pa.id', '=', 'pat.product_attribute_id')->leftJoin('product_pricing as pp', 'pp.product_id', '=', 'products.id')->leftJoin('product_attributes_boolean as pab', 'products.id', '=', 'pab.product_id')->leftJoin('product_attributes as patt', function ($join) {
         $join->on('patt.id', '=', 'pab.product_attribute_id')->where('patt.alias', '=', 'prepayment_allowed');
     })->leftJoin('price_types as pt', 'pt.id', '=', 'pp.price_type')->leftJoin('product_vendor_locations as pvl', 'pvl.product_id', '=', 'products.id')->leftJoin('vendor_locations as vl', 'vl.id', '=', 'pvl.vendor_location_id')->leftJoin('product_media_map as pmm', function ($join) {
         $join->on('pmm.product_id', '=', 'products.id')->where('pmm.media_type', '=', 'main');
     })->leftJoin('product_curator_map as pcm', 'pcm.product_id', '=', 'products.id')->leftJoin('curators', 'curators.id', '=', 'pcm.curator_id')->leftJoin('media', 'media.id', '=', 'pmm.media_id')->leftJoin('media_resized_new as cm', 'cm.id', '=', 'curators.media_id')->join('vendors', 'vendors.id', '=', 'vl.vendor_id')->leftJoin('product_attributes_integer as pai', 'pai.product_id', '=', 'products.id')->leftJoin('product_attributes as pa2', 'pa2.id', '=', 'pai.product_attribute_id')->leftJoin('vendor_location_address as vla', 'vla.vendor_location_id', '=', 'vl.id')->join('locations as loc1', 'loc1.id', '=', 'vla.area_id')->join('locations as loc2', 'loc2.id', '=', 'vla.city_id')->join('locations as loc3', 'loc3.id', '=', 'vla.state_id')->join('locations as loc4', 'loc4.id', '=', 'vla.country_id')->join('locations as loc5', 'loc5.id', '=', 'vl.location_id')->where('products.id', $experienceID)->where('pvl.status', 'Active');
     //adding additional parameters in case of simple experience
     if ($queryType && $queryType->type == 'simple') {
         $queryExperience->leftJoin(DB::raw('product_attributes_text as pat3'), 'pat3.product_id', '=', 'products.id')->leftJoin(DB::raw('product_attributes as pa3'), 'pa3.id', '=', 'pat3.product_attribute_id')->where('pa3.alias', 'menu')->select('products.id', 'products.name', 'products.type', 'pp.price', 'pp.tax', 'pcm.curator_tips as tips', 'pp.taxes', 'pt.type_name as price_type', 'pp.is_variable', 'pp.post_tax_price', DB::raw('MAX(IF(pa.alias = "experience_info", pat.attribute_value, "")) AS experience_info'), DB::raw('MAX(IF(pa.alias = "short_description", pat.attribute_value, "")) AS short_description'), DB::raw('MAX(IF(pa.alias = "terms_and_conditions", pat.attribute_value, "")) AS terms_and_conditions'), DB::raw('MAX(IF(pa.alias = "menu", pat.attribute_value, "")) AS menu'), DB::raw('MAX(IF(pa.alias = "experience_includes", pat.attribute_value, "")) AS experience_includes'), DB::raw('MAX(IF(pa2.alias = "reward_points_per_reservation", pai.attribute_value,"")) as reward_points'), 'media.file as experience_image', 'curators.name as curator_name', 'curators.bio as curator_bio', 'curators.designation', 'cm.file as curator_image', 'pvl.id as product_vendor_location_id', 'vendors.name as vendor_name', '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', 'vla.address', 'vla.pin_code', 'vla.latitude', 'vla.longitude', 'pab.attribute_value as prepayment_allowed', 'products.slug');
     } else {
         $queryExperience->leftJoin(DB::raw('product_attributes_text as pat3'), 'pat3.product_id', '=', 'products.id')->leftJoin(DB::raw('product_attributes as pa3'), 'pa3.id', '=', 'pat3.product_attribute_id')->where('pa3.alias', 'menu')->select('products.id', 'products.name', 'products.type', 'pp.price', 'pp.tax', 'pt.type_name as price_type', 'pp.is_variable', 'pp.post_tax_price', 'pat1.attribute_value as experience_info', 'curators.name as curator_name', 'curators.bio as curator_bio', 'curators.designation', 'pat2.attribute_value as short_description', 'media.file as experience_image', 'cm.file as curator_image', 'pat4.attribute_value as terms_and_condition', 'pvl.id as product_vendor_location_id', 'pcm.curator_tips as tips', 'pat5.attribute_value as experience_includes', 'vendors.name as vendor_name', 'reward_points', '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', 'vla.address', 'vla.pin_code', 'vla.latitude', 'vla.longitude', 'pab.attribute_value as prepayment_allowed', 'products.slug');
     }
     //running the query to get the results
     //echo $queryExperience->t`oSql();
     $expResult = $queryExperience->first();
     //array to store the experience details
     $arrExpDetails = array();
     if ($expResult) {
         //reading all the reviews for the particular experience
         $arrReviews = Review::readProductReviews($expResult->id);
         //reading other locations where same product is found
         $arrLocation = Self::getProductLocations($expResult->id, $expResult->product_vendor_location_id);
         //reading all the images of the product
         $arrImage = Self::getProductImages($experienceID);
         //reading all the addons associated with the product
         $arrAddOn = self::readExperienceAddOns($expResult->id);
         $arrExpDetails['data'] = array('id' => $expResult->id, 'name' => $expResult->name, 'vendor_name' => is_null($expResult->vendor_name) ? "" : $expResult->vendor_name, 'experience_info' => is_null($expResult->experience_info) ? "" : $expResult->experience_info, 'experience_includes' => is_null($expResult->experience_includes) ? "" : $expResult->experience_includes, 'short_description' => is_null($expResult->short_description) ? "" : $expResult->short_description, 'terms_and_condition' => is_null($expResult->terms_and_conditions) ? "" : $expResult->terms_and_conditions, 'image' => $arrImage, 'type' => $expResult->type, 'reward_points' => is_null($expResult->reward_points) ? 0 : $expResult->reward_points, 'price' => is_null($expResult->price) ? 0 : $expResult->price, 'taxes' => is_null($expResult->taxes) ? 0 : $expResult->taxes, 'pre_tax_price' => is_null($expResult->price) ? "" : $expResult->price, 'post_tax_price' => is_null($expResult->post_tax_price) ? "" : $expResult->post_tax_price, 'tax' => is_null($expResult->tax) ? "" : $expResult->tax, 'price_type' => is_null($expResult->price_type) ? "" : $expResult->price_type, 'curator_information' => array('curator_name' => is_null($expResult->curator_name) ? "" : $expResult->curator_name, 'curator_bio' => is_null($expResult->curator_bio) ? "" : $expResult->curator_bio, 'curator_image' => is_null($expResult->curator_image) ? "" : Config::get('constants.API_MOBILE_IMAGE_URL') . $expResult->curator_image, 'curator_designation' => is_null($expResult->designation) ? "" : $expResult->designation, 'suggestions' => is_null($expResult->tips) ? "" : $expResult->tips), 'menu' => is_null($expResult->menu) ? "" : $expResult->menu, 'rating' => is_null($arrReviews['avg_rating']) ? 0 : $arrReviews['avg_rating'], 'total_reviews' => $arrReviews['total_rating'], 'review_detail' => $arrReviews['reviews'], 'location' => $arrLocation, 'similar_option' => array(), 'prepayment_allowed' => empty($expResult->prepayment_allowed) ? '' : $expResult->prepayment_allowed, 'addons' => $arrAddOn, 'location_address' => array("address_line" => is_null($expResult->address) ? "" : $expResult->address, "locality" => is_null($expResult->locality) ? "" : $expResult->locality, "area" => is_null($expResult->area) ? "" : $expResult->area, "city" => is_null($expResult->city) ? "" : $expResult->city, "pincode" => is_null($expResult->pin_code) ? "" : $expResult->pin_code, "state" => is_null($expResult->state_name) ? "" : $expResult->state_name, "country" => is_null($expResult->country) ? "" : $expResult->country, "latitude" => is_null($expResult->latitude) ? "" : $expResult->latitude, "longitude" => is_null($expResult->longitude) ? "" : $expResult->longitude), 'slug' => $expResult->slug, 'bookmark_status' => is_null($bookmark) ? 0 : 1);
         $arrExpDetails['status'] = Config::get('constants.API_SUCCESS');
     }
     return $arrExpDetails;
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:61,代码来源:Experiences.php

示例2: myReservLocality

    /**
     * Handles requests for myReservLocality a reservation.
     * 
     * @access	public
     * @return	response
     * @since	1.0.0
     */
    public function myReservLocality()
    {
        $product_id = $this->request->input('product_id');
        $city_id = $this->request->input('city_id');
        $res_id = $this->request->input('res_id');
        $vendor_location_id = $this->request->input('vendor_location_id');
        $selectArea = DB::select("SELECT `pvl`.`id` AS `vendor_location_id` , `l1`.`name` AS area\n\t\t\t\t\tFROM `product_vendor_locations` AS `pvl`\n\t\t\t\t\tLEFT JOIN vendor_location_address AS vla ON `vla`.`vendor_location_id` = `pvl`.`vendor_location_id`\n\t\t\t\t\tLEFT JOIN `locations` AS `l1` ON `l1`.`id` = `vla`.`area_id`\n\t\t\t\t\tLEFT JOIN `locations` AS `l2` ON `l2`.`id` = `vla`.`city_id`\n\t\t\t\t\tLEFT JOIN `locations` AS `l3` ON `l3`.`id` = `vla`.`state_id`\n\t\t\t\t\tWHERE `pvl`.`product_id` = '{$product_id}'\n\t\t\t\t\tAND `vla`.`city_id` = '{$city_id}'\n\t\t\t\t\tAND `pvl`.`id` = '{$vendor_location_id}'");
        //print_r($selectArea);
        $areaId = $selectArea[0]->vendor_location_id;
        $areaName = $selectArea[0]->area;
        //exit;
        $selectVendorLocationIdQuery = DB::select("SELECT vendor_location_id FROM reservation_details WHERE id = '{$res_id}'");
        $selectVendorLocationId = $selectVendorLocationIdQuery[0]->vendor_location_id;
        $arrLocation = Self::getProductLocations($product_id, $city_id);
        //print_r($arrLocation);
        if (count($arrLocation) > 1) {
            ?>
			<div class="panel panel-default">
                <div class="panel-heading active">
                  <h4 class="panel-title">
                     <a href="javascript:" style="text-decoration: none;">
                      Select Location<input type="hidden" value="<?php 
            echo $product_id;
            ?>
" id="my_product_id"> <span id="get_locality"><input type="hidden" id="locality_val" value="<?php 
            echo $selectVendorLocationId;
            ?>
"></span></a>
					  <input type="hidden" name="old_area" value="<?php 
            echo $areaName;
            ?>
" id="old_area_name"/>
					  <input type="hidden" name="old_locality_value" value="<?php 
            echo $selectVendorLocationId;
            ?>
" id="old_locality_value"/>
					  <input type="hidden" name="new_locality_value" value="" id="new_locality_value"/>
                      <a  href="javascript:" data-original-title="Select the total number of guests at the table. If a larger table size is needed, please contact the WowTables Concierge." data-placement="top" data-toggle="tooltip" class="btn tooltip1"></a>
		              <select name="locality" id="locality"  class="pull-right space" style="display:none;">
		                    <option value="0">SELECT</option>
		                 
		            	  <?php 
            foreach ($arrLocation as $key => $listData) {
                ?>
		             			<option value="<?php 
                echo $listData['vendor_location_id'];
                ?>
" <?php 
                if ($areaId == $listData['vendor_location_id']) {
                    echo 'selected';
                }
                ?>
 ><?php 
                echo $listData['area'];
                ?>
</option>
		                        <?php 
            }
            ?>

		             </select>
                        <strong><a id="locality_select" href="javascript:"  style="text-decoration: none;float: right;font-size: 13px;color: #EAB703;" >
                        	<span style="color:#756554 !important;" id="myselect_locality"><?php 
            echo $areaName;
            ?>
</span> EDIT</a></strong>
                  </h4>
                </div>
              </div>
		
		<?php 
        }
    }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:80,代码来源:RegistrationsController.php

示例3: find

 public function find($experienceID, $cityID)
 {
     //echo " exp == ".$experienceID.", city = ".$cityID;
     //query to read product type
     $queryType = DB::table('products')->where('id', $experienceID)->select('name', 'type')->first();
     //query to read the experience detail
     $queryExperience = DB::table('products')->leftJoin('product_attributes_text as pat', 'pat.product_id', '=', 'products.id')->leftJoin('product_attributes_date as pad', 'pad.product_id', '=', 'products.id')->leftJoin('product_attributes_date as pad1', 'pad1.product_id', '=', 'products.id')->leftJoin('product_attributes_boolean as pab', 'pab.product_id', '=', 'products.id')->leftJoin('product_attributes_integer as pai', 'pai.product_id', '=', 'products.id')->leftJoin('product_attributes as pa', 'pa.id', '=', 'pat.product_attribute_id')->leftJoin('product_attributes as pa1', 'pa1.id', '=', 'pad.product_attribute_id')->leftJoin('product_attributes as pa2', 'pa2.id', '=', 'pad1.product_attribute_id')->leftJoin('product_attributes as pa4', 'pa4.id', '=', 'pai.product_attribute_id')->leftJoin('product_attributes as pa5', 'pa5.id', '=', 'pab.product_attribute_id')->leftJoin('product_pricing as pp', 'pp.product_id', '=', 'products.id')->leftJoin('price_types as pt', 'pt.id', '=', 'pp.price_type')->leftJoin('product_vendor_locations as pvl', 'pvl.product_id', '=', 'products.id')->leftJoin('vendor_locations as vl', 'vl.id', '=', 'pvl.vendor_location_id')->leftJoin('product_media_map as pmm', function ($join) {
         $join->on('pmm.product_id', '=', 'products.id')->where('pmm.media_type', '=', 'main');
     })->leftJoin('product_curator_map as pcm', 'pcm.product_id', '=', 'products.id')->leftJoin('curators', 'curators.id', '=', 'pcm.curator_id')->leftJoin('media', 'media.id', '=', 'pmm.media_id')->leftJoin('media_resized_new as cm', 'cm.id', '=', 'curators.media_id')->join('vendors', 'vendors.id', '=', 'vl.vendor_id')->where('products.id', $experienceID)->where('pvl.status', 'Active');
     //->where('pa1.alias','experience_info')
     //->where('pa2.alias','short_description')
     //->where('pa4.alias','terms_and_conditions')
     //->where('pa5.alias','experience_includes');
     //adding additional parameters in case of simple experience
     if ($queryType && $queryType->type == 'simple') {
         $queryExperience->leftJoin(DB::raw('product_attributes_text as pat3'), 'pat3.product_id', '=', 'products.id')->leftJoin(DB::raw('product_attributes as pa3'), 'pa3.id', '=', 'pat3.product_attribute_id')->where('pa3.alias', 'menu')->select('products.id', 'products.name', 'products.type', 'pp.price', 'pp.tax', 'products.slug', 'pt.type_name as price_type', 'pp.is_variable', 'pp.post_tax_price', 'pp.taxes', DB::raw('MAX(IF(pa.alias = "experience_info", pat.attribute_value, "")) AS experience_info'), DB::raw('MAX(IF(pa.alias = "short_description", pat.attribute_value, "")) AS short_description'), DB::raw('MAX(IF(pa.alias = "terms_and_conditions", pat.attribute_value, "")) AS terms_and_conditions'), DB::raw('MAX(IF(pa.alias = "menu", pat.attribute_value, "")) AS menu'), DB::raw('MAX(IF(pa.alias = "menu_html", pat.attribute_value, "")) AS menu_html'), DB::raw('MAX(IF(pa.alias = "experience_includes", pat.attribute_value, "")) AS experience_includes'), DB::raw('MAX(IF(pa.alias = "seo_meta_desciption", pat.attribute_value, "")) AS seo_meta_desciption'), DB::raw('MAX(IF(pa.alias = "seo_title", pat.attribute_value, "")) AS seo_title'), DB::raw('MAX(IF(pa.alias = "seo_meta_keywords", pat.attribute_value, "")) AS seo_meta_keywords'), DB::raw('MAX(IF(pa1.alias = "start_date", pad.attribute_value, "")) AS start_date'), DB::raw('MAX(IF(pa2.alias = "end_date", pad1.attribute_value, "")) AS end_date'), DB::raw('MAX(IF(pa4.alias = "reward_points_per_reservation", pai.attribute_value, "")) AS reward_points'), DB::raw('MAX(IF(pa5.alias = "allow_gift_card_redemptions", pab.attribute_value, "")) AS gift_card'), DB::raw('MAX(IF(pa5.alias = "prepayment_allowed", pab.attribute_value, "")) AS prepaid'), 'media.file as experience_image', 'curators.name as curator_name', 'curators.bio as curator_bio', 'curators.designation', 'cm.file as curator_image', 'pvl.id as product_vendor_location_id', 'vendors.name as vendor_name', 'vendors.id as vendor_id', 'pvl.status as pvl_status');
     } else {
         $queryExperience->leftJoin(DB::raw('product_attributes_text as pat3'), 'pat3.product_id', '=', 'products.id')->leftJoin(DB::raw('product_attributes as pa3'), 'pa3.id', '=', 'pat3.product_attribute_id')->where('pa3.alias', 'menu')->select('products.id', 'products.name', 'products.type', 'products.slug', 'pp.price', 'pp.tax', 'pt.type_name as price_type', 'pp.is_variable', 'pp.post_tax_price', 'pat1.attribute_value as experience_info', 'curators.name as curator_name', 'curators.bio as curator_bio', 'curators.designation', 'pat2.attribute_value as short_description', 'media.file as experience_image', 'cm.file as curator_image', 'pat4.attribute_value as terms_and_condition', 'pvl.id as product_vendor_location_id', 'pat5.attribute_value as experience_includes', 'vendors.name as vendor_name', 'vendors.id as vendor_id');
     }
     //running the query to get the results
     //echo $queryExperience->toSql();
     $expResult = $queryExperience->first();
     //echo "saa = ".$expResult->taxes." , ";
     //echo (!empty($expResult->taxes)) ? $expResult->taxes : 'Taxes Applicable';
     //echo "<pre>"; print_r($expResult); die;
     //array to store the experience details
     $arrExpDetails = array();
     if ($expResult) {
         //getting the reviews for the particular experience
         $arrReviews = Self::readProductReviews($expResult->id);
         $arrCuisines = Self::getExperienceCuisine($expResult->id);
         $arrLocation = Self::getProductLocations($expResult->id, $expResult->product_vendor_location_id, $cityID);
         $arrImage = Self::getProductImages($expResult->id);
         //reading all the addons associated with the product
         $arrAddOn = self::readExperienceAddOns($expResult->id);
         $arrExpDetails['data'] = array('id' => $expResult->id, 'name' => $expResult->name, 'slug' => $expResult->slug, 'vendor_name' => $expResult->vendor_name, 'vendor_id' => $expResult->vendor_id, 'experience_info' => $expResult->experience_info, 'experience_includes' => $expResult->experience_includes, 'short_description' => $expResult->short_description, 'terms_and_condition' => $expResult->terms_and_conditions, 'seo_meta_desciption' => $expResult->seo_meta_desciption, 'seo_title' => $expResult->seo_title, 'seo_meta_keywords' => $expResult->seo_meta_keywords, 'start_date' => $expResult->start_date, 'end_date' => $expResult->end_date, 'image' => $arrImage, 'type' => $expResult->type, 'price' => $expResult->price, 'taxes' => !empty($expResult->taxes) ? $expResult->taxes : 'Taxes Applicable', 'pre_tax_price' => is_null($expResult->price) ? "" : $expResult->price, 'post_tax_price' => is_null($expResult->post_tax_price) ? "" : $expResult->post_tax_price, 'prepaid' => !empty($expResult->prepaid) ? $expResult->prepaid : "0", 'tax' => is_null($expResult->tax) ? "" : $expResult->tax, 'price_type' => is_null($expResult->price_type) ? "" : $expResult->price_type, 'curator_name' => is_null($expResult->curator_name) ? "" : $expResult->curator_name, 'curator_bio' => is_null($expResult->curator_bio) ? "" : $expResult->curator_bio, 'curator_image' => is_null($expResult->curator_image) ? "" : Config::get('constants.API_MOBILE_IMAGE_URL') . $expResult->curator_image, 'curator_designation' => is_null($expResult->designation) ? "" : $expResult->designation, 'menu' => $expResult->menu, 'menu_html' => $expResult->menu_html, 'rating' => is_null($arrReviews['avg_rating']) ? 0 : $arrReviews['avg_rating'], 'total_reviews' => $arrReviews['total_rating'], 'review_detail' => $arrReviews['reviews'], 'cuisine' => array_key_exists($expResult->id, $arrCuisines) ? $arrCuisines[$expResult->id] : array(), 'location' => $arrLocation, 'addons' => $arrAddOn, 'reward_points' => $expResult->reward_points, 'gift_card' => $expResult->gift_card, 'pvl_status' => $expResult->pvl_status, 'similar_option' => array());
     }
     return $arrExpDetails;
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:39,代码来源:ExperienceModel.php


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