Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Web Section (Homepage Section)

Sort the data by rank Logic:

WHEN rsr.rank IS NULL THEN 1 ELSE 0 END
When restaurant have rank it will mark as 0
When restaurant doesn’t have rank it will mark as 1
So, when you have 5 restaurant and the first rank will get from first data that return 0, then it will continue using restaurant rank

you can change the restaurant rank on /admin/restaurant_sections?locale=thmake sure the restaurant was active before set the rank

for All Restaurant:

  • get the data from compact restaurant (only active restaurant)

  • sort the data by rank

  • and sort again the data by rank ASC

  • Section 1

    Happy with the fusion restaurant 😋

    • get the data from compact restaurant (only active restaurant)
    • get data from report filter by date(Today - 1 week ago) and filter by name section_12
    • sort the data by rank
    • and sort the data from the biggest total restaurant from report
  • Section 3

    Daily Picks (The Best Seafood Restaurant)

    • get the data from compact restaurant (only active restaurant)
    • get the data from report name w1_recommendation, and Date (Today - 7 days ago)
    • sort the data by rank
    • and sort the data from the biggest total w1_recommendation restaurant from report
  • Section 5

    Top Brands (Popular Brands)

    • get the total data restaurant from report name popular branch and get data by date (Today - 3 days ago)
    • get all data branch and get the same data as from the report
    • and sort the data from the biggest total popular branch restaurant from report
  • Section 6

    Best Restaurants for under ฿1,000

    • get the data from compact restaurant (only active restaurant)
    • get the data from report name under_1000b, and Date (Today - 3 days ago)
    • sort the data by rank
    • and sort the data from the biggest total under_1000b restaurant from report
  • Section 7

    Top Categories/Cuisines

    • get data from restaurant that active, and the city id same as the city id that we insert like “bangkok”
    • get report name top_category_cuisine, or top_category_location, or top_category_korean, or top_category_hotel from date between today and 3 days ago
    • get total restaurant data from report
    • get the restaurant data that have cover
    • and sort data from the biggest total from report
  • Section 8

    Trending Restaurant

    • get the data from compact restaurant (only active restaurant)
    • get data report trending restaurant from today - 1 day ago
    • get data same data from compact restaurant and from report
    • sort by rank
    • sort again the result data DESC
  • Section 9

    New Partners or New Restaurants

    • get the data from compact restaurant (only active restaurant)
    • sort the data by rank
    • and sort the data from the biggest total new restaurant from report
    • and sort again by latest restaurant start date
  • Section 11

    Staycation

    • get the data from compact restaurant (only active restaurant)
    • get the data from report name top_staycation, and Date (Today - 2 days ago)
    • sort the data by rank
    • and sort the data from the biggest total top_staycation restaurant from report
  • Section 13

    More To Explore (All Restaurant)

    • get the data from compact restaurant (only active restaurant)
    • sort the data by rank
    • and sort again from best to least restaurant
  • for New Restaurant

    • it sort by premium_delivery_offers_hashtag
    • get data from today till 1 week ago report premium delivery offers hashtag
    • and get the data from compact restaurant (only active restaurant)
    • sort the data by rank
    • sort again the report data from best to least premium delivery offers hashtag