From aa808affa7b6ec7169c652f1e8a91c0ee235d81d Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 28 Oct 2024 15:15:14 +0800 Subject: [PATCH] . --- app.py | 9 ++++++++- templates/edit_customers.html | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index ceb64ca..4bb87e9 100644 --- a/app.py +++ b/app.py @@ -110,6 +110,7 @@ def view_customer(index): # 添加统计逻辑 total_emails = 0 cold_lead_count = 0 + no_promotion_count = 0 # 遍历所有客户数据 for customer in customer_data: @@ -120,6 +121,10 @@ def view_customer(index): # 检查邮件是否属于 "cold lead" if email.get('category', '').lower() == "cold lead": cold_lead_count += 1 + # 检查是否没有推广历史 + promotion_history = email.get('promotion history', []) + if not promotion_history: + no_promotion_count += 1 is_first = index == 0 is_last = index == len(customer_data) - 1 @@ -131,7 +136,9 @@ def view_customer(index): is_first=is_first, is_last=is_last, total_emails=total_emails, - cold_lead_count=cold_lead_count) + cold_lead_count=cold_lead_count, + no_promotion_count=no_promotion_count) + # @app.route('/customer/') # def view_customer(index): diff --git a/templates/edit_customers.html b/templates/edit_customers.html index 60be372..d89f188 100644 --- a/templates/edit_customers.html +++ b/templates/edit_customers.html @@ -82,7 +82,7 @@
-

Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }}

+

Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }}