def userData(request): ''' 返回用户信息: 在线人数、今日签到、从未签到、从未使用 ''' data = [NodeOnlineLog.totalOnlineUser(), len(User.todayRegister()), SSUser.userTodyChecked(), SSUser.userNeverChecked(), SSUser.userNeverUsed(), ] return JsonResponse({'data': data})
def userData(request): ''' 返回用户信息: 在线人数、今日签到、从未签到、从未使用 ''' data = [NodeOnlineLog.totalOnlineUser(), len(User.todayRegister()), SSUser.userTodyChecked(), SSUser.userNeverChecked(), SSUser.userNeverUsed(), ] result = json.dumps(data, ensure_ascii=False) return HttpResponse(result, content_type='application/json')
def userData(request): ''' 返回用户信息: 在线人数、今日签到、从未签到、从未使用 ''' data = [NodeOnlineLog.totalOnlineUser(), len(User.todayRegister()), SSUser.userTodyChecked(), SSUser.userNeverChecked(), SSUser.userNeverUsed(), ] result = json.dumps(data, ensure_ascii=False) return HttpResponse(result, content_type='application/json')
def user_status(request): '''站内用户分析''' # 查询今日注册的用户 todayRegistered = User.todayRegister().values() for t in todayRegistered: try: t['inviter'] = User.objects.get(pk=t['invited_by']) except: t['inviter'] = 'ehco' todayRegisteredNum = len(todayRegistered) # 查询消费水平前十的用户 richUser = Donate.richPeople() # 查询流量用的最多的用户 coreUser = SSUser.coreUser() context = { 'userNum': User.userNum(), 'todayChecked': SSUser.userTodyChecked(), 'aliveUser': NodeOnlineLog.totalOnlineUser(), 'todayRegistered': todayRegistered[:10], 'todayRegisteredNum': todayRegisteredNum, 'richUser': richUser, 'coreUser': coreUser, } return render(request, 'backend/userstatus.html', context=context)
def user_status(request): '''站内用户分析''' # 查询今日注册的用户 todayRegistered = User.todayRegister().values() for t in todayRegistered: try: t['inviter'] = User.objects.get(pk=t['invited_by']) except: t['inviter'] = 'ehco' todayRegisteredNum = len(todayRegistered) # 查询消费水平前十的用户 richUser = Donate.richPeople() # 查询流量用的最多的用户 coreUser = SSUser.coreUser() context = { 'userNum': User.userNum(), 'todayChecked': SSUser.userTodyChecked(), 'aliveUser': NodeOnlineLog.totalOnlineUser(), 'todayRegistered': todayRegistered[:10], 'todayRegisteredNum': todayRegisteredNum, 'richUser': richUser, 'coreUser': coreUser, } return render(request, 'backend/userstatus.html', context=context)