|
@@ -7,6 +7,7 @@
|
|
|
@Software: PyCharm
|
|
|
"""
|
|
|
import itertools
|
|
|
+from Ansjer.config import CONFIG_INFO, CONFIG_EUR
|
|
|
from django.db.models import Value, CharField, Q
|
|
|
from Model.models import EquipmentInfo1, EquipmentInfo2, EquipmentInfo3, EquipmentInfo4, EquipmentInfo5, \
|
|
|
EquipmentInfo6, EquipmentInfo7, EquipmentInfo8, EquipmentInfo9, EquipmentInfo10, \
|
|
@@ -459,7 +460,9 @@ class EquipmentInfoService:
|
|
|
|
|
|
if not equipment_info_union.exists():
|
|
|
return None, 0
|
|
|
- count = 1
|
|
|
+ if CONFIG_EUR == CONFIG_INFO:
|
|
|
+ line = 10
|
|
|
+ count = 21
|
|
|
|
|
|
equipment_info_union = cls.get_equipment_info_union_page(equipment_info_union, page, line)
|
|
|
return equipment_info_union, count
|
|
@@ -566,7 +569,10 @@ class EquipmentInfoService:
|
|
|
count += equipment_info_model.objects.filter(**kwargs).count()
|
|
|
if count == 0:
|
|
|
return count
|
|
|
- redis_obj.set_data(key, count, 60)
|
|
|
+ if CONFIG_EUR == CONFIG_INFO and count > 99:
|
|
|
+ redis_obj.set_data(key, count, 300)
|
|
|
+ else:
|
|
|
+ redis_obj.set_data(key, count, 60)
|
|
|
return count
|
|
|
|
|
|
@classmethod
|