-
echo Location::find() ->where(['user_id' => $user_id]) ->andWhere(['and', ['>', 'location_update_time', $time], ['<', 'location_update_time', $time+86400]]) ->andWhere(['<>', 'location_name', '']) ->groupBy('location_name') ->having("count('location_name')>30") ->orderBy('location_update_time desc') ->limit(50) ->createCommand() ->getRawSql();