Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.88 KB | None | 0 0
  1. select `task_vks`.`id`, `task_vks`.`user_id` from `task_vks` inner join `users` on `users`.`id` = `task_vks`.`user_id` inner join `tariff_plans` on `tariff_plans`.`id` = `users`.`tariff_plan_id` where (`cron_work_is` = '0' or (`cron_work_is` = '1' and (`cron_work_last` < '2017-11-20 10:09:59' or `cron_work_last` is null or `cron_work_next` is null))) and (`cron_work_next` < '2017-11-20 10:39:59' or `cron_work_next` is null) and ((`tariff_plans`.`price_month` > '0' and FLOOR(ROUND(users.money, 2) / ROUND((tariff_plans.price_month / 30), 2)) > 0 and (`users`.`suspend_billing` is null or `users`.`suspend_billing` between '2017-11-20 00:00:00' and '2017-11-20 23:59:59')) or (`tariff_plans`.`price_month` = '0' and `tariff_plans`.`day_limit` > DATEDIFF(CURDATE(), users.`tariff_plan_change_last`))) and (`status` = 'work_in') and `task_vks`.`deleted_at` is null order by `cron_work_last` asc limit 2200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement