SHARE
TWEET

Untitled

a guest Dec 11th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.       DISTINCT `tours_periods_pools_prices`.*, `tours_periods_pools`.`id`
  3.     FROM
  4.          `tours`
  5.     LEFT JOIN
  6.         `tours_periods`
  7.     ON
  8.         `tours_periods`.`tour_id` = `tours`.`id`
  9.     LEFT JOIN
  10.        `tours_periods_transfer_tariffs`
  11.     ON
  12.        `tours_periods_transfer_tariffs`.`period_id` = `tours_periods`.`id` AND `tours_periods_transfer_tariffs`.`tour_day` = 1
  13.     LEFT JOIN
  14.        transfer_tariffs_dates_stops
  15.     ON
  16.         (tours_periods_transfer_tariffs.transfer_tariffs_dates_id = transfer_tariffs_dates_stops.tt_dates_id)
  17.     AND
  18.         (tours_periods_transfer_tariffs.tt_stop_from = transfer_tariffs_dates_stops.tt_stop_id)
  19.     LEFT JOIN
  20.       `transfer_tariffs_stops`
  21.     ON
  22.       `transfer_tariffs_stops`.`id` = `transfer_tariffs_dates_stops`.`tt_stop_id`
  23.     LEFT JOIN
  24.       `reference_city`
  25.     ON
  26.       `reference_city`.`id` = `transfer_tariffs_stops`.`reference_city_id`
  27.     LEFT JOIN
  28.       `tours_periods_pools`
  29.     ON
  30.       `tours_periods_pools`.`period_id` = `tours_periods`.`id`
  31.     LEFT JOIN
  32.       `tours_periods_pools_prices`
  33.     ON
  34.       `tours_periods_pools_prices`.`pool_id` = `tours_periods_pools`.`id`
  35.     WHERE
  36.       `tours`.`id` = '10'
  37.     AND
  38.        (
  39.         (`tours_periods`.`date_start` = '2019-04-16' and `tours_periods`.`full_set` = 0)
  40.             or
  41.         (
  42.                 `tours_periods`.`full_set` = 1
  43.             and
  44.                 `tours_periods`.`date_start` <= '2019-04-16'
  45.             and
  46.                 `tours_periods`.`date_to` >= '2019-04-16'
  47.             and
  48.                 `tours_periods`.`week_day` LIKE '%2;%'
  49.         )
  50.        )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top