新设备
This commit is contained in:
parent
fa3cb17c61
commit
5df64d9db9
@ -94,7 +94,7 @@ async def order_idx(request, rdb, data):
|
|||||||
@TaHandler
|
@TaHandler
|
||||||
async def role_idx(request, rdb, data):
|
async def role_idx(request, rdb, data):
|
||||||
"""
|
"""
|
||||||
标记角色编号
|
滚服,标记角色编号;标记新设备
|
||||||
:param request:
|
:param request:
|
||||||
:param rdb:
|
:param rdb:
|
||||||
:param data:
|
:param data:
|
||||||
@ -106,12 +106,21 @@ async def role_idx(request, rdb, data):
|
|||||||
# key = $appid.$binduid v : uid
|
# key = $appid.$binduid v : uid
|
||||||
account = data.get("properties", {}).get("binduid")
|
account = data.get("properties", {}).get("binduid")
|
||||||
account_id = data.get("#account_id")
|
account_id = data.get("#account_id")
|
||||||
|
distinct_id = data.get("#distinct_id")
|
||||||
if account and account_id:
|
if account and account_id:
|
||||||
key = f'{data["#app_id"]}_{account}_roles'
|
key = f'{data["#app_id"]}_{account}_roles'
|
||||||
v = await rdb.execute('sadd', key, account_id)
|
v = await rdb.execute('sadd', key, account_id)
|
||||||
# 新角色 编号
|
# 新角色 编号
|
||||||
if v == 1:
|
if v == 1:
|
||||||
data['properties']['role_idx'] = await rdb.execute('scard', key)
|
data['properties']['role_idx'] = await rdb.execute('scard', key)
|
||||||
|
# sadd O(n)
|
||||||
|
# if distinct_id:
|
||||||
|
# key = f'{data["#app_id"]}_devices'
|
||||||
|
# v = await rdb.execute('sadd', key, distinct_id)
|
||||||
|
# if v:
|
||||||
|
# data['properties']['is_new_device'] = 1
|
||||||
|
# else:
|
||||||
|
# data['properties']['is_new_device'] = 0
|
||||||
|
|
||||||
# @TaHandler
|
# @TaHandler
|
||||||
# async def device_label(request, rdb, data):
|
# async def device_label(request, rdb, data):
|
||||||
|
Loading…
Reference in New Issue
Block a user