SELECT id, cuisine_fr AS cuisine, cuisine_url_fr AS cuisine_url FROM cuisines WHERE cuisine_url_fr='thai' AND status=1 SELECT id, cuisine_fr AS cuisine, cuisine_url_fr AS cuisine_url FROM cuisines WHERE cuisine_url_fr='nouilles' AND status=1 SELECT id, cuisine_fr AS cuisine, cuisine_url_fr AS cuisine_url FROM cuisines WHERE cuisine_url_fr='pates' AND status=1 SELECT id, cuisine_fr AS cuisine, cuisine_url_fr AS cuisine_url FROM cuisines WHERE cuisine_url_fr='thai' AND status=1 SELECT id, cuisine_fr AS cuisine, cuisine_url_fr AS cuisine_url FROM cuisines WHERE cuisine_url_fr='nouilles' AND status=1 SELECT id, cuisine_fr AS cuisine, cuisine_url_fr AS cuisine_url FROM cuisines WHERE cuisine_url_fr='pates' AND status=1 SELECT listings_track.id, listings_track.id_listing, COUNT(ads_cpc_track.id) AS cpc_count FROM listings_track LEFT JOIN listings_url ON listings_track.id_listing_url = listings_url.id LEFT JOIN ads_cpc_track ON listings_track.id = ads_cpc_track.id_listing_track WHERE id_ua_user=471911 AND listings_url.url='/livraison/shops-thai,nouilles,pates.htm?hour=soon' AND date > (UNIX_TIMESTAMP()-21600) GROUP BY listings_track.id SELECT SQL_CALC_FOUND_ROWS restaurants.cache_visits, restaurants.oo_presence, restaurants.id, restaurants.booking, restaurants.oo, restaurants.restaurant, restaurants.restaurant_url,restaurants.picture, restaurants.picture_date, restaurants.city, restaurants.zipcode, restaurants.hb, restaurants.latitude, restaurants.longitude, restaurants.oo_delivery_type, restaurants.oo_takeaway, restaurants.cache_gold, restaurants.cache_favorite, restaurants.cache_ads_offer, restaurants.oo_preparation_time, restaurants.oo_preparation_time_1, restaurants.oo_preparation_time_2, restaurants.oo_preparation_time_3, restaurants_delivery_areas.delivery_time, restaurants_delivery_areas.minimum_order_lunch, restaurants_delivery_areas.minimum_order_dinner, ro.discount_rate, ro.offer_fr, ro.offer_en, ro.description_fr, ro.description_en, gcp.localite_fr, gcp.localite_en, restaurants.cache_cuisines_fr AS cuisines, IF( ((ads_cpc.date_end IS NOT NULL AND ads_cpc.date_start <= UNIX_TIMESTAMP() AND ads_cpc.date_end >= UNIX_TIMESTAMP()) OR (ads_cpc.date_end IS NULL AND ads_cpc.date_start <= UNIX_TIMESTAMP())) AND ads_cpc.daily_balance>=ads_cpc.cpc, ads_cpc.id, NULL) AS id_ads_cpc, IF( ((ads_cpc.date_end IS NOT NULL AND ads_cpc.date_start <= UNIX_TIMESTAMP() AND ads_cpc.date_end >= UNIX_TIMESTAMP()) OR (ads_cpc.date_end IS NULL AND ads_cpc.date_start <= UNIX_TIMESTAMP())) AND ads_cpc.daily_balance>=ads_cpc.cpc, ads_cpc.cpc,0) AS cpc , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN ads_cpc ON restaurants.id = ads_cpc.id_restaurant AND ads_cpc.status=1 LEFT JOIN restaurants_offers ro ON restaurants.id = ro.id_restaurant AND ro.date_start <= UNIX_TIMESTAMP() AND ro.date_end >= UNIX_TIMESTAMP() AND ro.status=1 AND ro.delivery=1 LEFT JOIN geo_cp gcp ON restaurants.id_cp = gcp.id LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE 1 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND cuisines.cuisine_url_fr IN ('thai','nouilles','pates') AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) GROUP BY restaurants.id ORDER BY oo_presence DESC, cpc DESC, IF((restaurants.oo_delivery_type=1 AND distance<=3.5) OR restaurants.oo_delivery_type=2,0,1) ASC, restaurants.rank_order DESC, restaurants.id DESC SELECT FOUND_ROWS(); SELECT MIN(id) AS id FROM listings WHERE 1 AND listing_show='1' AND listing_sort='0' AND type='delivery' AND id_keyword='0' AND id_ads_event='0' AND geo='0' AND id_region='0' AND id_region2='0' AND id_ville='0' AND id_address='0' AND geoloc='0' AND radius='0' AND area_coord_1_latitude='0' AND area_coord_1_longitude='0' AND area_coord_2_latitude='0' AND area_coord_2_longitude='0' AND cache_offer='0' AND valet_lunch='0' AND valet_dinner='0' AND places_terrace='0' AND open_night='0' AND cache_open='0' AND booking='0' AND hb='0' AND id_chain='0' AND soon='1' AND nb_days='0' AND nb_filters = 3 AND ( SELECT COUNT(*) FROM listings_detail WHERE listings_detail.id_listing = listings.id AND listings_detail.filter='cuisine' AND listings_detail.value='13' ) = 1 AND ( SELECT COUNT(*) FROM listings_detail WHERE listings_detail.id_listing = listings.id AND listings_detail.filter='cuisine' AND listings_detail.value='70' ) = 1 AND ( SELECT COUNT(*) FROM listings_detail WHERE listings_detail.id_listing = listings.id AND listings_detail.filter='cuisine' AND listings_detail.value='67' ) = 1SELECT id FROM listings_url WHERE url='/livraison/shops-thai,nouilles,pates.htm?hour=soon'INSERT INTO listings_url SET url='/livraison/shops-thai,nouilles,pates.htm?hour=soon'INSERT INTO listings_track SET id_listing='163133', date=UNIX_TIMESTAMP(), id_listing_url='449762', results='0', id_customer='0', id_ua_user='471911', id_ua_visit='472252', id_source='0' SELECT geo_regions.id, geo_regions.region_fr AS region, geo_regions.region_url_fr AS region_url, COUNT(restaurants.id) nb_r , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN geo_cp ON restaurants.id_cp = geo_cp.id LEFT JOIN geo_villes ON geo_cp.id_ville = geo_villes.id LEFT JOIN geo_regions2 ON geo_villes.id_region2 = geo_regions2.id LEFT JOIN geo_regions ON geo_regions2.id_region = geo_regions.id LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE restaurants.status=1 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND cuisines.cuisine_url_fr IN ('thai','nouilles','pates') AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) GROUP BY geo_regions.id ORDER BY nb_r DESC SELECT ads_events.label_filter_fr AS label_filter, ads_events.url_fr AS url , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN ads_events_restaurants ON restaurants.id=ads_events_restaurants.id_restaurant LEFT JOIN ads_events ON ads_events_restaurants.id_ads_events=ads_events.id LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE ads_events.date_start <= UNIX_TIMESTAMP() AND ads_events.date_end >= UNIX_TIMESTAMP() AND ads_events.status=1 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND cuisines.cuisine_url_fr IN ('thai','nouilles','pates') AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) GROUP BY ads_events.id SELECT cuisines.id, cuisines.cuisine_fr AS cuisine, cuisines.cuisine_url_fr AS cuisine_url, COUNT(restaurants.id) nb_r , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE cuisines.status=1 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) GROUP BY cuisines.id ORDER BY nb_r DESC, cuisine SELECT dishes1.id AS id_dish, dishes1.dish1_fr AS dish1, dishes1.dish1_url_fr AS dish1_url, dishes1.filter, GROUP_CONCAT(DISTINCT CONCAT_WS('|',dishes2.id, dishes2.dish2_fr, dishes2.dish2_url_fr)) AS dishes2, COUNT(restaurants.id) nb_r , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN restaurants_dishes2 ON restaurants.id=restaurants_dishes2.id_restaurant LEFT JOIN dishes2 ON restaurants_dishes2.id_dish2=dishes2.id LEFT JOIN dishes1 ON dishes2.id_dish1=dishes1.id LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE dishes2.status=1 AND dishes1.status=1 AND dishes1.filter != 0 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND cuisines.cuisine_url_fr IN ('thai','nouilles','pates') AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) GROUP BY dishes1.id ORDER BY nb_r DESC, dish1 SELECT 1 , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE restaurants.cache_offer=1 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND cuisines.cuisine_url_fr IN ('thai','nouilles','pates') AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) SELECT restaurants.average_price , addresses.id AS id_address, restaurants_distances.distance AS address_distance,lunch_start_h, lunch_start_m, dinner_start_h ,dinner_start_m, lunch_end_h, lunch_end_m, dinner_end_h ,dinner_end_m FROM restaurants LEFT JOIN addresses ON addresses.id=0 LEFT JOIN restaurants_delivery_areas_zipcode ON restaurants.id=restaurants_delivery_areas_zipcode.id_restaurant AND restaurants_delivery_areas_zipcode.id_cp=addresses.id_cp LEFT JOIN restaurants_delivery_areas ON restaurants_delivery_areas_zipcode.id_area=restaurants_delivery_areas.id LEFT JOIN restaurants_distances ON addresses.id=restaurants_distances.id_address AND restaurants.id=restaurants_distances.id_restaurant LEFT JOIN restaurants_cuisines ON restaurants.id=restaurants_cuisines.id_restaurant LEFT JOIN cuisines ON restaurants_cuisines.id_cuisine=cuisines.id LEFT JOIN restaurants_hours_orders ON restaurants.id=restaurants_hours_orders.id_restaurant AND day=2 LEFT JOIN holidays_jewish ON holidays_jewish.date_start <= UNIX_TIMESTAMP() AND holidays_jewish.date_end >= UNIX_TIMESTAMP() WHERE 1 AND restaurants.oo=1 AND restaurants.oo_delivery=1 AND restaurants.subscription=1 AND restaurants.status=1 AND cuisines.cuisine_url_fr IN ('thai','nouilles','pates') AND ( restaurants.oo_presence=1 OR restaurants.oo_preorder=1 ) GROUP BY restaurants.average_price