コード例 #1
0
 function details($city = '', $alaslug = '')
 {
     DB::connection()->enableQueryLog();
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $data['cities'] = $cities;
     //$data['allow_guest'] = true;
     $check_userid = '`order`,id desc';
     $data['user'] = Auth::user();
     $city_name = 'mumbai';
     if (!empty($data['user'])) {
         $users_city = $data['user']->location_id;
         $user_id = $data['user']->id;
         $city_name = Location::where(['Type' => 'City', 'id' => $users_city])->pluck('name');
         if (empty($city_name)) {
             $city_name = 'mumbai';
         }
         $check_userid = "if(bookmark_userid = " . $user_id . ", 0, if(bookmark_userid != " . $user_id . ", 1, 1)),`order` asc";
     }
     $city_id = Location::where(['Type' => 'City', 'name' => $city])->first()->id;
     //echo "==".$alacarte_id    = Vendor::where(['slug' => $alaslug])->first()->id;
     $aLaCarteID = DB::table('vendor_locations')->where('slug', $alaslug)->first()->id;
     $arrALaCarte = $this->alacarte_model->getALaCarteDetails($aLaCarteID);
     //echo "<pre>"; print_r($data); die;
     $data['arrALaCarte'] = $arrALaCarte;
     $data['reserveData'] = $this->alacarte_model->getAlacarteLimit($aLaCarteID);
     $data['block_dates'] = $this->alacarte_model->getAlacarteBlockDates($aLaCarteID);
     $data['schedule'] = $this->alacarte_model->getAlacarteLocationSchedule($aLaCarteID);
     $data['scheduleDays'] = $this->alacarte_model->getAlacarteLocationScheduleDays($aLaCarteID);
     $data['relatedRestaurants'] = $this->alacarte_model->getRelatedRestaurants($aLaCarteID, $city_id, $data['arrALaCarte']['data']['cuisineID']);
     $data['relatedExperiences'] = $this->alacarte_model->getRelatedExperiences($aLaCarteID, $city_id);
     $data['availableDates'] = $this->alacarte_model->getAvailableDates($data['block_dates'], $data['scheduleDays']);
     //echo "<pre>"; print_r($data['scheduleDays']); print_r($data['availableDates']); die;
     /*echo '<pre>';
       print_r($data['arrALaCarte']);
       print_r( $data['reserveData']);
       print_r( $data['block_dates']);
       print_r( $data['schedule']);
       echo '</pre>';*/
     $data['hasOrder'] = '';
     $data['allow_guest'] = 'Yes';
     $data['current_city'] = strtolower($city);
     $data['current_city_id'] = $city_id;
     $commonmodel = new CommonModel();
     $data['allCuisines'] = $commonmodel->getAllCuisines();
     $data['allAreas'] = $commonmodel->getAllAreas();
     $data['allPrices'] = $commonmodel->getAllPrices();
     $data['dropdowns_opt'] = 0;
     //1 for disp
     //$seo_title = (isset($data['arrALaCarte']['data']['seo_title']) && $data['arrALaCarte']['data']['seo_title'] != "" ? $data['arrALaCarte']['data']['seo_title'] : 'Wowtables');
     //$meta_desc = (isset($data['arrALaCarte']['data']['seo_meta_description']) && $data['arrALaCarte']['data']['seo_meta_description'] != "" ? $data['arrALaCarte']['data']['seo_meta_description'] : 'Wowtables');
     //$meta_keywords = (isset($data['arrALaCarte']['data']['seo_meta_keywords']) && $data['arrALaCarte']['data']['seo_meta_keywords'] != "" ? $data['arrALaCarte']['data']['seo_meta_keywords'] : 'Wowtables');
     /*print_r($data['arrALaCarte']['data']['location_address']);
       exit;*/
     $seo_title = $data['arrALaCarte']['data']['seo_title'];
     $meta_desc = $data['arrALaCarte']['data']['seo_meta_description'];
     $meta_keywords = $data['arrALaCarte']['data']['seo_meta_keywords'];
     if ($seo_title == '') {
         $seoTitleDetails = 'WowTables: ' . $data['arrALaCarte']['data']['title'] . ', ' . $data['arrALaCarte']['data']['location_address']['city'] . ', ' . $data['arrALaCarte']['data']['location_address']['area'];
         /*print_r($seoTitleDetails);
           exit;*/
     } else {
         $seoTitleDetails = $seo_title;
         /*print_r($seoTitleDetails);
           exit;*/
     }
     if ($meta_desc == '') {
         $metaDescDetails = 'Reserve a table at ' . $data['arrALaCarte']['data']['title'] . 'Enjoy in ' . $data['arrALaCarte']['data']['location_address']['area'] . ', ' . $data['arrALaCarte']['data']['location_address']['city'] . ' Find information, curators suggestions, maps, address, photos and reviews';
     } else {
         $metaDescDetails = $meta_desc;
     }
     if ($meta_keywords == '') {
         $metaKeyDetails = 'WowTables: ' . $data['arrALaCarte']['data']['title'] . ', ' . $data['arrALaCarte']['data']['location_address']['city'] . ', ' . $data['arrALaCarte']['data']['location_address']['area'];
     } else {
         $metaKeyDetails = $meta_keywords;
     }
     $meta_information = array('seo_title' => $seoTitleDetails, 'meta_desc' => $metaDescDetails, 'meta_keywords' => $metaKeyDetails);
     /* print_r($meta_information);
        exit;*/
     //var_dump($data);die;
     return view('frontend.pages.alacartedetails', $data)->with('meta_information', $meta_information);
 }
コード例 #2
0
 /**
  * Mumbai jain collection
  *
  * @param $city
  * @return view
  */
 public function collection($collection = "")
 {
     //this code is start in header and footer page.
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $arrResponse['cities'] = $cities;
     $arrResponse['user'] = Auth::user();
     $city_id = Input::get('city');
     $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');
     if (empty($city_name)) {
         $city_name = 'mumbai';
     }
     $arrResponse['allow_guest'] = 'Yes';
     $arrResponse['current_city'] = strtolower($city_name);
     $arrResponse['current_city_id'] = $city_id;
     $commonmodel = new CommonModel();
     $arrResponse['allCuisines'] = $commonmodel->getAllCuisines();
     $arrResponse['allAreas'] = $commonmodel->getAllAreas();
     $arrResponse['allPrices'] = $commonmodel->getAllPrices();
     $arrResponse['dropdowns_opt'] = 1;
     //1 for disp
     //this code is start in header and footer page.
     $collectionQuery = "SELECT tags.`id`, tags.`name` , tags.`slug` , tags.`collection` , tags.`description` , tags.`seo_title` , tags.`seo_meta_description` , tags.`seo_meta_keywords` , \n                            media_resized_new.`file`, media_resized_new.`height`, media_resized_new.`width`, media_resized_new.`image_type`\n                            FROM tags\n                            INNER JOIN media_resized_new ON tags.`web_media_id` = media_resized_new.`media_id`\n                            WHERE tags.`slug` = '{$collection}'\n                            AND tags.`status` = 'available'";
     $collectionResult = DB::select($collectionQuery);
     //exclusiveexperiences query
     $exclusiveExperiences = DB::select("SELECT t.name, t.slug,p.name AS productname,p.slug AS slug, pat.attribute_value, \n                                            pa.name as productattrname, pp.price, pt.type_name, mrn.file,f.name as flagname,f.color,p.id,\n                                            l.name as cityname,MAX(IF(pa.alias = 'short_description', pat.attribute_value, '')) AS short_description\n                                            FROM tags AS t\n                                            LEFT JOIN product_tag_map AS ptm ON t.id = ptm.tag_id\n                                            LEFT JOIN products AS p ON p.id = ptm.product_id\n                                            LEFT JOIN product_attributes_text AS pat ON pat.product_id = p.id\n                                            LEFT JOIN product_attributes AS pa ON pa.id = pat.product_attribute_id\n                                            LEFT JOIN product_pricing AS pp ON pp.product_id = p.id\n                                            LEFT JOIN price_types AS pt ON pt.id = pp.price_type\n                                            LEFT JOIN product_media_map AS pmm ON pmm.product_id = p.id\n                                            LEFT JOIN media_resized_new AS mrn ON mrn.media_id = pmm.media_id\n                                            LEFT JOIN product_flag_map as pfm on pfm.product_id = p.id\n                                            LEFT JOIN flags as f on pfm.flag_id = f.id\n                                            LEFT JOIN product_vendor_locations as pvl on pvl.product_id = p.id\n                                            LEFT JOIN vendor_location_address as vla on vla.vendor_location_id= pvl.vendor_location_id\n                                            LEFT JOIN locations as l on l.id = vla.city_id\n                                            WHERE t.slug = '{$collection}'\n                                            AND mrn.image_type = 'listing'\n                                            AND t.status = 'available'\n                                            AND pvl.status = 'Active'\n                                            group by p.id");
     // print_r($exclusiveExperiences);
     //exit;
     $arrData = array();
     //close code by product review and rating.
     $arrProduct = array('59', '63', '62');
     $arrRatings = $this->findRatingByProduct($arrProduct);
     foreach ($exclusiveExperiences as $row) {
         $arrData['data'][] = array('name' => $row->name, 'productname' => $row->productname, 'slug' => $row->slug, 'attribute_value' => $row->attribute_value, 'short_description' => $row->short_description, 'productattrname' => $row->productattrname, 'price' => $row->price, 'type_name' => $row->type_name, 'file' => $row->file, 'flagname' => $row->flagname, 'color' => $row->color, 'id' => $row->id, 'cityname' => strtolower($row->cityname), 'rating' => array_key_exists($row->id, $arrRatings) ? $arrRatings[$row->id]['averageRating'] : 0, 'total_reviews' => array_key_exists($row->id, $arrRatings) ? $arrRatings[$row->id]['totalRating'] : 0, 'full_stars' => array_key_exists($row->id, $arrRatings) ? $arrRatings[$row->id]['full_stars'] : 0, 'half_stars' => array_key_exists($row->id, $arrRatings) ? $arrRatings[$row->id]['half_stars'] : 0, 'blank_stars' => array_key_exists($row->id, $arrRatings) ? $arrRatings[$row->id]['blank_stars'] : 0);
     }
     //end exclusiveexperiences query
     $alaCartaArData = array();
     //start query a lart cart query
     $alacartQuery = DB::select("SELECT t.name AS tagsname, t.slug AS tagsslug, vl.slug AS vendorlocationslug,\n                                         v.name AS vendorlocations,v.id, l.name AS city,l.slug, mrn.file AS imagename, f.name as flagname,f.color,\n                                         vl.pricing_level, vlat.attribute_value,la.name as locationarea,vaso.option\n                                            FROM tags AS t\n                                            INNER JOIN vendor_locations_tags_map AS vltm ON t.id = vltm.tag_id\n                                            INNER JOIN vendor_locations AS vl ON vl.id = vltm.vendor_location_id\n                                            INNER JOIN vendors AS v ON v.id = vl.vendor_id\n                                            INNER JOIN vendor_location_address AS vla ON vla.vendor_location_id = vl.id\n                                            INNER JOIN locations AS l ON l.id = vla.city_id\n                                            INNER JOIN vendor_locations_media_map AS vlmm ON vlmm.vendor_location_id = vl.id\n                                            INNER JOIN media_resized_new AS mrn ON mrn.media_id = vlmm.media_id\n                                            INNER JOIN vendor_location_attributes_text AS vlat ON vlat.vendor_location_id = vl.id\n                                            INNER JOIN vendor_attributes AS va ON va.id = vlat.vendor_attribute_id\n                                            INNER JOIN locations AS la ON la.id = vla.area_id\n                                            INNER JOIN vendor_location_attributes_multiselect AS vlam ON vlam.vendor_location_id = vl.id\n                                            INNER JOIN vendor_attributes_select_options AS vaso ON vaso.id = vlam.vendor_attributes_select_option_id\n                                            LEFT JOIN vendor_locations_flags_map as vfm on vfm.vendor_location_id = vl.id\n                                            LEFT JOIN flags as f on vfm.flag_id = f.id\n                                            WHERE t.slug = '{$collection}'\n                                            AND t.status = 'available'\n                                            AND mrn.image_type = 'listing'\n                                            AND vl.status = 'Active'\n                                            AND va.alias = 'short_description' GROUP BY vl.id");
     /*print_r($arrData);
       foreach ($arrData['data'] as $data)
       {
          echo $data['slug'];
       }*/
     // exit;
     foreach ($alacartQuery as $row2) {
         $alaCartaArData['data'][] = array('tagsname' => $row2->tagsname, 'tagsslug' => $row2->tagsslug, 'vendorlocationslug' => $row2->vendorlocationslug, 'id' => $row2->id, 'vendorlocationsName' => $row2->vendorlocations, 'city' => $row2->city, 'imagename' => $row2->imagename, 'pricing_level' => $row2->pricing_level, 'attribute_value' => $row2->attribute_value, 'flagname' => $row2->flagname, 'color' => $row2->color, 'locationarea' => $row2->locationarea, 'option' => $row2->option, 'review_detail' => $this->getVendorLocationRatingDetails($row2->id));
     }
     /*print_r($alaCartaArData);
       exit;*/
     return view('frontend.pages.collection', $arrResponse)->with('collectionResult', $collectionResult)->with('exclusiveExperiences', $exclusiveExperiences)->with('arrData', $arrData)->with('alaCartaArData', $alaCartaArData);
 }