This commit is contained in:
parent
d42004ac9c
commit
32680e29b9
14
app.py
14
app.py
|
|
@ -158,7 +158,12 @@ def index():
|
|||
|
||||
|
||||
|
||||
|
||||
# New function to count the number of companies
|
||||
def count_companies():
|
||||
company_count = 0
|
||||
for customer in customer_data:
|
||||
company_count += len(customer) # Each domain in the customer dictionary represents a company
|
||||
return company_count
|
||||
|
||||
|
||||
def calculate_statistics():
|
||||
|
|
@ -209,6 +214,9 @@ def view_customer(index):
|
|||
# 调用统计函数,获取统计数据
|
||||
total_emails, cold_lead_count, no_promotion_count = calculate_statistics()
|
||||
|
||||
# Call new function to count companies
|
||||
company_count = count_companies()
|
||||
|
||||
return render_template('edit_customers.html',
|
||||
customer=customer,
|
||||
index=index,
|
||||
|
|
@ -216,8 +224,8 @@ def view_customer(index):
|
|||
is_last=is_last,
|
||||
total_emails=total_emails,
|
||||
cold_lead_count=cold_lead_count,
|
||||
no_promotion_count=no_promotion_count)
|
||||
|
||||
no_promotion_count=no_promotion_count,
|
||||
company_count=company_count)
|
||||
|
||||
|
||||
@app.route('/update/<int:index>', methods=['POST'])
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
|
||||
<!-- Fixed status bar -->
|
||||
<div class="status-bar">
|
||||
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }}</p>
|
||||
<p>Total Emails: {{ total_emails }} | Cold Leads: {{ cold_lead_count }} | No Promotion: {{ no_promotion_count }} | Total Companies: {{ company_count }}</p>
|
||||
</div>
|
||||
|
||||
<!-- JavaScript for navigation functions -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue