设备转移之后,匹配异常问题

dependabot/npm_and_yarn/fir_admin/url-parse-1.5.10
nineven 3 years ago
parent 6051f443c1
commit 875a3a4305
  1. 9
      fir_ser/api/utils/app/supersignutils.py
  2. 30
      fir_ser/api/utils/modelutils.py

@ -20,7 +20,7 @@ from api.models import APPSuperSignUsedInfo, AppUDID, AppIOSDeveloperInfo, AppRe
IosDeveloperBill
from api.utils.app.iossignapi import ResignApp, AppDeveloperApiV2
from api.utils.modelutils import get_ios_developer_public_num, check_ipa_is_latest_sign, \
get_developer_can_used_from_public_sign, update_or_create_developer_udid_info, check_uid_has_relevant
update_or_create_developer_udid_info, check_uid_has_relevant
from api.utils.response import BaseResponse
from api.utils.serializer import BillAppInfoSerializer, BillDeveloperInfoSerializer
from api.utils.storage.caches import del_cache_response_by_short, send_msg_over_limit, check_app_permission, \
@ -233,9 +233,7 @@ def get_new_developer_by_app_obj(app_obj, obj_base_filter, apple_to_app=False):
developer_obj_lists = developer_obj_lists.all().distinct().order_by("created_time")
for developer_obj in developer_obj_lists:
# 通过开发者数限制进行过滤
used_number = get_developer_udided(developer_obj)[2] + get_developer_can_used_from_public_sign(
developer_obj.user_id)
if used_number < developer_obj.usable_number:
if get_developer_udided(developer_obj)[2] < developer_obj.usable_number:
if apple_to_app:
apple_to_app_obj = AppleDeveloperToAppUse.objects.filter(app_id=app_obj,
developerid=developer_obj).first()
@ -327,8 +325,7 @@ def get_developer_user_by_app_udid(user_objs, udid, app_obj, private_first=True,
# developer_obj_dict_queryset = filter_developer_by_pk_list(developer_pk_list, 'developerappid')
# developer_pk_list = [developer_obj_dict.get('pk') for developer_obj_dict in developer_obj_dict_queryset]
for developer_obj in AppIOSDeveloperInfo.objects.filter(pk__in=developer_pk_list):
if get_developer_udided(developer_obj)[2] + get_developer_can_used_from_public_sign(
developer_obj.user_id) < developer_obj.usable_number:
if get_developer_udided(developer_obj)[2] < developer_obj.usable_number:
exist_app_developer_pk_list.append(developer_obj.pk)
# 查询状态正常的专属开发者信息,判断是否为专属应用

@ -199,21 +199,21 @@ def get_user_public_used_sign_num(user_obj):
return number if number else 0
def get_developer_can_used_from_public_sign(user_obj):
o_number_info = IosDeveloperBill.objects.filter(to_user_id__isnull=False, user_id=user_obj).values(
'number').aggregate(number=Sum('number'))
o_number = o_number_info.get("number", 0)
if o_number is None:
o_number = 0
u_number_info = IosDeveloperPublicPoolBill.objects.filter(
user_id_id__in=IosDeveloperBill.objects.filter(user_id=user_obj).values('to_user_id_id')).values(
'number',
'udid_sync_info_id').annotate(
counts=Count('udid_sync_info_id')).aggregate(number=Sum('number'))
u_number = u_number_info.get("number", 0)
if u_number is None:
u_number = 0
return o_number - u_number
# def get_developer_can_used_from_public_sign(user_obj):
# o_number_info = IosDeveloperBill.objects.filter(to_user_id__isnull=False, user_id=user_obj).values(
# 'number').aggregate(number=Sum('number'))
# o_number = o_number_info.get("number", 0)
# if o_number is None:
# o_number = 0
# u_number_info = IosDeveloperPublicPoolBill.objects.filter(
# user_id_id__in=IosDeveloperBill.objects.filter(user_id=user_obj).values('to_user_id_id')).values(
# 'number',
# 'udid_sync_info_id').annotate(
# counts=Count('udid_sync_info_id')).aggregate(number=Sum('number'))
# u_number = u_number_info.get("number", 0)
# if u_number is None:
# u_number = 0
# return o_number - u_number
def check_super_sign_permission(user_obj):

Loading…
Cancel
Save