This commit is contained in:
parent
c5fad0da54
commit
aa808affa7
9
app.py
9
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/<int:index>')
|
||||
# def view_customer(index):
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
|
||||
<!-- 固定状态栏 -->
|
||||
<div class="status-bar">
|
||||
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }}</p>
|
||||
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }}</p>
|
||||
</div>
|
||||
|
||||
<!-- JavaScript 脚本 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue