|
@@ -218,25 +218,26 @@ class HomeDataView(View):
|
|
break
|
|
break
|
|
if flag == 0:
|
|
if flag == 0:
|
|
user_all_temp_list.append(item)
|
|
user_all_temp_list.append(item)
|
|
- for item in user_increase_temp_list:
|
|
|
|
- rate = round(item['count'] / user_increase_count * 100, 2)
|
|
|
|
- if rate >= 10:
|
|
|
|
- item['rate'] = rate
|
|
|
|
- user_increase_list.append(item)
|
|
|
|
- else:
|
|
|
|
- user_increase_other_dict['count'] += item['count']
|
|
|
|
- user_increase_other_dict['rate'] = round(user_increase_other_dict['count'] / user_increase_count * 100, 2)
|
|
|
|
- user_increase_list.append(user_increase_other_dict)
|
|
|
|
-
|
|
|
|
- for item in user_all_temp_list:
|
|
|
|
- rate = round(item['count'] / user_all_count * 100, 2)
|
|
|
|
- if rate >= 10:
|
|
|
|
- item['rate'] = rate
|
|
|
|
- user_all_list.append(item)
|
|
|
|
- else:
|
|
|
|
- user_all_other_dict['count'] += item['count']
|
|
|
|
- user_all_other_dict['rate'] = round(user_all_other_dict['count'] / user_increase_count * 100, 2)
|
|
|
|
- user_all_list.append(user_all_other_dict)
|
|
|
|
|
|
+ if user_increase_temp_list:
|
|
|
|
+ for item in user_increase_temp_list:
|
|
|
|
+ rate = round(item['count'] / user_increase_count * 100, 2)
|
|
|
|
+ if rate >= 10:
|
|
|
|
+ item['rate'] = rate
|
|
|
|
+ user_increase_list.append(item)
|
|
|
|
+ else:
|
|
|
|
+ user_increase_other_dict['count'] += item['count']
|
|
|
|
+ user_increase_other_dict['rate'] = round(user_increase_other_dict['count'] / user_increase_count * 100, 2)
|
|
|
|
+ user_increase_list.append(user_increase_other_dict)
|
|
|
|
+ if user_all_temp_list:
|
|
|
|
+ for item in user_all_temp_list:
|
|
|
|
+ rate = round(item['count'] / user_all_count * 100, 2)
|
|
|
|
+ if rate >= 10:
|
|
|
|
+ item['rate'] = rate
|
|
|
|
+ user_all_list.append(item)
|
|
|
|
+ else:
|
|
|
|
+ user_all_other_dict['count'] += item['count']
|
|
|
|
+ user_all_other_dict['rate'] = round(user_all_other_dict['count'] / user_all_count * 100, 2)
|
|
|
|
+ user_all_list.append(user_all_other_dict)
|
|
res = {
|
|
res = {
|
|
'userIncreaseCount': user_increase_count,
|
|
'userIncreaseCount': user_increase_count,
|
|
'userActiveCount': user_active_count,
|
|
'userActiveCount': user_active_count,
|