Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT `users`.`id` AS `user_id`,
- `users`.`name` AS `user_name`,
- `users`.`email` AS `email`,
- `users`.`point` AS `user_point`,
- FROM_UNIXTIME(SUBSTRING_INDEX(
- GROUP_CONCAT(
- DISTINCT user_point_logs.expire_date
- ORDER BY user_point_logs.expire_date
- ASC SEPARATOR ','),',',1), '%Y-%m-%d'
- )
- AS user_expire_date,
- SUBSTRING_INDEX(
- GROUP_CONCAT(
- DISTINCT user_point_logs.point
- ORDER BY user_point_logs.expire_date
- ASC SEPARATOR ','),',',1
- )
- AS user_point_next_expire
- FROM `user_point_logs`
- LEFT JOIN `users` ON
- (`users`.`id` = `user_point_logs`.`user_id`)
- WHERE `user_point_logs`.`point` > 0
- AND `user_point_logs`.`expire_date` > 1539770111
- AND `users`.`disable` = 0 AND `users`.`point` > 0
- AND `users`.`point` IS NOT null
- AND `users`.`is_ml_bounced` = 0
- AND (`user_point_logs`.`return_id` = 0
- OR `user_point_logs`.`return_id` IS null)
- AND `user_point_logs`.`user_id`
- BETWEEN 16077 AND 16083
- GROUP BY `user_point_logs`.`user_id`
Add Comment
Please, Sign In to add comment