SELECT u.*, COUNT(s.*) cnt
FROM users u
LEFT JOIN subscribes s ON u.user_id = s.to_user_id
GROUP BY u.user_id
ORDER BY u.rating DESC, cnt DESC, u.place ASC
SELECT item.*
FROM plug_cat_join_cat_item item
LEFT JOIN plug_cat_vals val ON val.write_id = item.id
WHERE val.write_id IS NOT NULL
LIMIT 64, 8