(cls, app, all=False, detail=True)
return users
:type app: wechat_django.models.WeChatApp
        :param all: 是否重新同步所有用户
        :param detail: 是否同步用户详情
:type app: wechat_django.models.WeChatApp
        :param all: 是否重新同步所有用户
        :param detail: 是否同步用户详情
: type app : wechat_django . models . WeChatApp : param all : 是否重新同步所有用户 : param detail : 是否同步用户详情
def sync(cls, app, all=False, detail=True):
        """
        :type app: wechat_django.models.WeChatApp
        :param all: 是否重新同步所有用户
        :param detail: 是否同步用户详情
        """
        # 只有重新同步详情的才能全量同步
        all = all and detail

        users = []
        next_openid = not all and app.ext_info.get("last_openid") or None

        iterator = app.client.user.iter_followers(next_openid)
        for openids in next_chunk(iterator):
            users.extend(cls.upsert_users(app, openids, detail))
            # 更新最后更新openid
            app.ext_info["last_openid"] = openids[-1]
            app.save()
        return users
def sync ( cls , app , all = False , detail = True ) : # 只有重新同步详情的才能全量同步 all = all and detail users = [ ] next_openid = not all and app . ext_info . get ( "last_openid" ) or None iterator = app . client . user . iter_followers ( next_openid ) for openids in next_chunk ( iterator ) : users . extend ( cls . upsert_users ( app , openids , detail ) ) # 更新最后更新openid app . ext_info [ "last_openid" ] = openids [ - 1 ] app . save ( ) return users