专属开发者被分配给了 {{ scope.row.app_private_number }} 个应用
- 专属开发者一共分配了 {{ scope.row.app_private_usable_number }} 个设备名额
+ 专属开发者一共分配了 {{ scope.row.private_usable_number }} 个设备名额
专属开发者已经被专属应用使用了 {{ scope.row.app_private_used_number }} 个设备名额
0:
@@ -714,6 +721,7 @@ class IosUtils(object):
logger.warning(
"call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count))
if self.developer_obj:
+ return 11111
# register_devices_prefix = f"check_or_register_devices_{self.developer_obj.issuer_id}_{self.udid}"
register_devices_prefix = f"check_or_register_devices_{self.developer_obj.issuer_id}"
add_new_bundles_prefix = f"check_or_add_new_bundles_{self.developer_obj.issuer_id}_{self.app_obj.app_id}"
diff --git a/fir_ser/api/utils/serializer.py b/fir_ser/api/utils/serializer.py
index fc651cf..c7b924b 100644
--- a/fir_ser/api/utils/serializer.py
+++ b/fir_ser/api/utils/serializer.py
@@ -159,6 +159,12 @@ class AppsSerializer(serializers.ModelSerializer):
def get_private_developer_number(self, obj):
return models.AppleDeveloperToAppUse.objects.filter(app_id=obj).count()
+ private_developer_used_number = serializers.SerializerMethodField()
+
+ def get_private_developer_used_number(self, obj):
+ return models.DeveloperDevicesID.objects.filter(app_id=obj,
+ developerid__appledevelopertoappuse__app_id=obj).distinct().count()
+
domain_name = serializers.SerializerMethodField()
def get_domain_name(self, obj):
@@ -456,12 +462,13 @@ class DeveloperSerializer(serializers.ModelSerializer):
developer_used_number = serializers.SerializerMethodField()
developer_used_other_number = serializers.SerializerMethodField()
use_number = serializers.SerializerMethodField()
- app_used_number = serializers.SerializerMethodField()
+ app_used_count = serializers.SerializerMethodField()
is_disabled = serializers.SerializerMethodField()
app_private_number = serializers.SerializerMethodField()
app_private_used_number = serializers.SerializerMethodField()
app_usable_number = serializers.SerializerMethodField()
- app_private_usable_number = serializers.SerializerMethodField()
+ app_used_number = serializers.SerializerMethodField()
+ private_usable_number = serializers.SerializerMethodField()
def get_app_usable_number(self, obj):
app_id = self.context.get('app_id')
@@ -472,6 +479,13 @@ class DeveloperSerializer(serializers.ModelSerializer):
return apple_to_app_obj.usable_number
return 0
+ def get_app_used_number(self, obj):
+ app_id = self.context.get('app_id', '')
+ if app_id:
+ return models.DeveloperDevicesID.objects.filter(developerid=obj,
+ app_id__app_id=app_id).distinct().count()
+ return 0
+
def get_developer_used_number(self, obj):
return models.UDIDsyncDeveloper.objects.filter(developerid=obj).count()
@@ -484,7 +498,7 @@ class DeveloperSerializer(serializers.ModelSerializer):
def get_app_private_number(self, obj):
return models.AppleDeveloperToAppUse.objects.filter(developerid=obj).count()
- def get_app_private_usable_number(self, obj):
+ def get_private_usable_number(self, obj):
used_number = models.AppleDeveloperToAppUse.objects.filter(developerid=obj).values('usable_number').aggregate(
Sum('usable_number')).get('usable_number__sum')
if not used_number:
@@ -492,12 +506,14 @@ class DeveloperSerializer(serializers.ModelSerializer):
return used_number
def get_app_private_used_number(self, obj):
- return models.DeveloperDevicesID.objects.filter(developerid=obj, app_id__appledevelopertoappuse__developerid=obj).values('udid').distinct().count()
+ return models.DeveloperDevicesID.objects.filter(developerid=obj,
+ app_id__appledevelopertoappuse__developerid=obj).values(
+ 'udid').distinct().count()
def get_use_number(self, obj):
return models.DeveloperDevicesID.objects.filter(developerid=obj).values('udid').distinct().count()
- def get_app_used_number(self, obj):
+ def get_app_used_count(self, obj):
return models.DeveloperAppID.objects.filter(developerid=obj).count()
@@ -858,5 +874,5 @@ class AppleDeveloperToAppUseAppsSerializer(serializers.ModelSerializer):
def get_app_used_number(self, obj):
issuer_id = self.context.get('issuer_id')
if issuer_id:
- return models.DeveloperDevicesID.objects.filter(app_id=obj,developerid__issuer_id=issuer_id).count()
- return 0
\ No newline at end of file
+ return models.DeveloperDevicesID.objects.filter(app_id=obj, developerid__issuer_id=issuer_id).count()
+ return 0
diff --git a/fir_ser/api/utils/utils.py b/fir_ser/api/utils/utils.py
index e24d1e8..01c9875 100644
--- a/fir_ser/api/utils/utils.py
+++ b/fir_ser/api/utils/utils.py
@@ -61,7 +61,7 @@ def get_developer_devices(developer_obj_lists):
other_used_sum = 0
flyapp_used_sum = 0
max_total = 0
- for dev_obj in developer_obj_lists:
+ for dev_obj in developer_obj_lists.filter(is_actived=True):
other_used, flyapp_used, _ = get_developer_udided(dev_obj)
other_used_sum += other_used
flyapp_used_sum += flyapp_used