|
@@ -275,37 +275,39 @@ class HomeDataView(View):
|
|
break
|
|
break
|
|
if flag == 0:
|
|
if flag == 0:
|
|
user_all_temp_list.append(item)
|
|
user_all_temp_list.append(item)
|
|
- if user_increase_temp_list:
|
|
|
|
- for item in user_increase_temp_list:
|
|
|
|
- if user_increase_count:
|
|
|
|
- rate = round(item['count'] / user_increase_count * 100, 2)
|
|
|
|
- else:
|
|
|
|
- rate = 0
|
|
|
|
- if rate >= 10:
|
|
|
|
- item['rate'] = rate
|
|
|
|
- user_increase_list.append(item)
|
|
|
|
- else:
|
|
|
|
- user_increase_other_dict['count'] += item['count']
|
|
|
|
- if user_increase_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:
|
|
|
|
- if user_all_count:
|
|
|
|
- rate = round(item['count'] / user_all_count * 100, 2)
|
|
|
|
- else:
|
|
|
|
- rate = 0
|
|
|
|
- if rate >= 10:
|
|
|
|
- item['rate'] = rate
|
|
|
|
- user_all_list.append(item)
|
|
|
|
- else:
|
|
|
|
- user_all_other_dict['count'] += item['count']
|
|
|
|
- if user_all_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)
|
|
|
|
else:
|
|
else:
|
|
return response.json(result['result_code'], result['result'])
|
|
return response.json(result['result_code'], result['result'])
|
|
|
|
+ if user_increase_temp_list:
|
|
|
|
+ for item in user_increase_temp_list:
|
|
|
|
+ if user_increase_count:
|
|
|
|
+ rate = round(item['count'] / user_increase_count * 100, 2)
|
|
|
|
+ else:
|
|
|
|
+ rate = 0
|
|
|
|
+ if rate >= 10:
|
|
|
|
+ item['rate'] = rate
|
|
|
|
+ user_increase_list.append(item)
|
|
|
|
+ else:
|
|
|
|
+ user_increase_other_dict['count'] += item['count']
|
|
|
|
+ if user_increase_count:
|
|
|
|
+ user_increase_other_dict['rate'] = round(
|
|
|
|
+ user_increase_other_dict['count'] / user_increase_count * 100, 2)
|
|
|
|
+ if user_increase_other_dict['count']:
|
|
|
|
+ user_increase_list.append(user_increase_other_dict)
|
|
|
|
+ if user_all_temp_list:
|
|
|
|
+ for item in user_all_temp_list:
|
|
|
|
+ if user_all_count:
|
|
|
|
+ rate = round(item['count'] / user_all_count * 100, 2)
|
|
|
|
+ else:
|
|
|
|
+ rate = 0
|
|
|
|
+ if rate >= 10:
|
|
|
|
+ item['rate'] = rate
|
|
|
|
+ user_all_list.append(item)
|
|
|
|
+ else:
|
|
|
|
+ user_all_other_dict['count'] += item['count']
|
|
|
|
+ if user_all_count:
|
|
|
|
+ user_all_other_dict['rate'] = round(user_all_other_dict['count'] / user_all_count * 100, 2)
|
|
|
|
+ if user_all_other_dict['count']:
|
|
|
|
+ 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,
|
|
@@ -353,6 +355,7 @@ class HomeDataView(View):
|
|
for each in order_list:
|
|
for each in order_list:
|
|
if item['startTime'] == each['startTime'] and item['endTime'] == each['endTime']:
|
|
if item['startTime'] == each['startTime'] and item['endTime'] == each['endTime']:
|
|
each['total'] += item['total']
|
|
each['total'] += item['total']
|
|
|
|
+ flag = 1
|
|
break
|
|
break
|
|
if flag == 0:
|
|
if flag == 0:
|
|
order_list.append(item)
|
|
order_list.append(item)
|