|
@@ -131,6 +131,12 @@ class StageCountView(APIView):
|
|
|
time_now = timezone.now().strftime('%Y-%m-%d')
|
|
|
for stage in stage_progress:
|
|
|
new_customers = NewCustomer.objects.filter(track_user=user, stage_progress=stage)
|
|
|
+ stage_count = {
|
|
|
+ 'stage': stage.name,
|
|
|
+ 'total': 0,
|
|
|
+ 'today_count': 0,
|
|
|
+ 'overdue_count': 0,
|
|
|
+ }
|
|
|
if new_customers:
|
|
|
stage_count = {
|
|
|
'stage': stage.name, # 阶段名称
|
|
@@ -138,5 +144,5 @@ class StageCountView(APIView):
|
|
|
'today_count': new_customers.filter(next_time=time_now).count(), # 今日人数
|
|
|
'overdue_count': new_customers.filter(next_time__lt=time_now).count() # 逾期人数
|
|
|
}
|
|
|
- data.append(stage_count)
|
|
|
+ data.append(stage_count)
|
|
|
return response_ok(data)
|