Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SQL_CALC_FOUND_ROWS R.RestaurantID AS RestaurantID,
- R.Title AS Title, R.Description AS Description, R.WorkHour AS WorkHour,
- R.ActualText AS ActualText, R.OfferText AS OfferText, R.CordinateX AS CordinateX, R.CordinateY AS CordinateY,
- R.Logo AS Logo, R.Phone AS Phone, R.Email AS Email, R.Website AS Website, R.Address AS Address,
- R.Postage AS Postage, R.City AS City, R.Options AS Options, R.RestaurantCategoryID AS RestaurantCategoryID,
- S.Paid AS Paid, (3959 * ACOS(COS(RADIANS(45.9589980)) * COS(RADIANS(CordinateX)) * COS(RADIANS(R.CordinateY) - RADIANS(15.4921310)) + SIN (RADIANS(45.9589980)) * SIN(RADIANS(R.CordinateX)))) AS Distance,
- IF(RL.RestaurantID IS NULL, FALSE, TRUE) as LunchActive FROM Restaurant R JOIN RestaurantCategory RC ON (R.RestaurantCategoryID = RC.RestaurantCategoryID)
- JOIN Subscription S ON (R.RestaurantID = S.RestaurantID)
- LEFT JOIN RestaurantLunch AS RL ON R.RestaurantID = RL.RestaurantID
- WHERE R.Status = 1 AND MATCH (R.Title, R.Description, R.City, R.Address, R.ActualText, R.OfferText, RL.Text) AGAINST ('maribor čevapčiči' IN BOOLEAN MODE) GROUP BY R.RestaurantID
- HAVING Distance < 100 ORDER BY Distance ASC, R.Title ASC LIMIT 1000;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement