$sql = "select a.id as max_id,a.uid from(SELECT `uid`, idFROM (`users_level_change_log`)WHERE `uid` IN ( ".$uids_str." )AND `level_type` = 2AND `create_time` < '{$now_month}'order by id desc ) as a group by a.uid";