-
{{ r.count_hits }}
+
+ 总下载次数:{{ r.count_hits }}
当天下载次数:{{ r.today_hits_count }}
+ {{ r.count_hits }} | {{ r.today_hits_count }}
+
diff --git a/fir_ser/admin/utils/serializer.py b/fir_ser/admin/utils/serializer.py
index c687799..ab31b35 100644
--- a/fir_ser/admin/utils/serializer.py
+++ b/fir_ser/admin/utils/serializer.py
@@ -136,11 +136,6 @@ class AdminAppsSerializer(AppsSerializer):
def get_release_count(self, obj):
return models.AppReleaseInfo.objects.filter(app_id=obj).count()
- today_hits_count = serializers.SerializerMethodField()
-
- def get_today_hits_count(self, obj):
- return get_app_today_download_times([obj.app_id])
-
def update(self, instance, validated_data):
return super(AdminAppsSerializer, self).update(instance, validated_data)
diff --git a/fir_ser/api/utils/serializer.py b/fir_ser/api/utils/serializer.py
index 56844ea..2c18047 100644
--- a/fir_ser/api/utils/serializer.py
+++ b/fir_ser/api/utils/serializer.py
@@ -12,7 +12,7 @@ from api.utils.modelutils import get_user_domain_name, get_app_domain_name, get_
from common.base.baseutils import get_choices_dict, WeixinLoginUid
from common.cache.storage import AdPicShowCache
from common.core.sysconfig import Config, UserConfig
-from common.utils.caches import get_user_free_download_times, get_user_cert_auth_status
+from common.utils.caches import get_user_free_download_times, get_user_cert_auth_status, get_app_today_download_times
from common.utils.storage import Storage
from common.utils.token import make_token
@@ -216,12 +216,16 @@ class AppsSerializer(serializers.ModelSerializer):
else:
return {}
+ today_hits_count = serializers.SerializerMethodField()
+
+ def get_today_hits_count(self, obj):
+ return get_app_today_download_times([obj.app_id])
class AppsListSerializer(AppsSerializer):
class Meta:
model = models.Apps
fields = ["app_id", "bundle_id", "issupersign", "name", "preview_url", "short", "type", "master_release",
- "has_combo", "count_hits"]
+ "has_combo", "count_hits", "today_hits_count"]
def get_master_release(self, obj):
master_release_obj = get_app_master_obj_from_context(self, obj)