sheenam12

Untitled

Mar 29th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. select `user`.`id`, `user`.`lat`, `user`.`lng`, ( 3959 * acos( cos( radians(30.77) ) * cos( radians(user.lat) )
  2. * cos( radians( user.lng ) - radians(76.77) ) + sin( radians(30.77) ) * sin(radians(user.lat)) ) ) AS distance from `user` left join `vendor_styles` on `user`.`id` = `vendor_styles`.`vendor_id` left join `vendor_days` on `user`.`id` = `vendor_days`.`vendor_id` left join `vendor_timing` on `user`.`id` = `vendor_timing`.`vendor_day_id` where `style_id` in (1, 2) and `flag` = 2 and `is_verified` = 1 and `is_online` = 1 and `day` = 1 and `available_time` between '19:46:00' and '21:44:00' group by `user`.`id` having `distance` < 10
Add Comment
Please, Sign In to add comment