需求描述

  1. 1、客户统计模块: 展示客户的服务次数(包含小的拜访记录次数与单条大拜访记录)、总支出情况、是否签约、签约合同金额
  2. 客户id
  3. 2、员工统计模块:员工服务过的客户(参与过的都包含在内)、员工服务次数、签约合同次数、
  4. 员工id

接口设计

客户统计接口

功能

根据客户id、单位id,展示客户的服务次数(包含小的拜访记录次数与单条大拜访记录)、总支出情况、是否签约、签约合同金额
客户的跟进情况

地址

/api/stats/customer

请求方法

GET

参数说明

名称 类型 说明 备注 是否必须
organization_id int 客户单位id 否,默认所有
customer_id int 客户id

start_time string 开始时间:2020-01-01 00:00:00
否,默认全部
end_time string 结束时间:2021-01-01 00:00:00
否,默认全部

返回格式

  1. {
  2. "status": 0,
  3. "data": [
  4. [
  5. {
  6. "organization_id": 1,
  7. "potential_count": 3,
  8. "follow_cost": 26.0,
  9. "follow_count": 3,
  10. "contract_amount": 24000.0,
  11. "contract_count": 1,
  12. "customer_status": 2,
  13. "organization_name": "耳尖团队"
  14. },
  15. {
  16. "organization_id": 2,
  17. "potential_count": 1,
  18. "follow_cost": 50.0,
  19. "follow_count": 1,
  20. "contract_amount": 0.0,
  21. "contract_count": 0,
  22. "customer_status": 1,
  23. "organization_name": "微舆"
  24. }
  25. ]
  26. ]
  27. }

员工统计接口

功能

员工服务过的客户(参与过的都包含在内)、员工服务次数、签约合同次数
员工对客户的跟进、对接情况

地址

/api/stats/customerstaff

请求方法

GET

参数说明

名称 类型 说明 备注 是否必须
user_id int 员工id 否,默认全部
start_time string 开始时间:2020-01-01 00:00:00
否,默认全部
end_time string 结束时间:2021-01-01 00:00:00
否,默认全部

返回格式

  1. {
  2. "status": 0,
  3. "data": [
  4. {
  5. "contract_count": 1,
  6. "contract_amount": 24000.0,
  7. "customer_info": [
  8. {
  9. "organization_id": 1,
  10. "follow_cost": 26.0,
  11. "follow_count": 3,
  12. "customer_status": 2
  13. }
  14. ],
  15. "organization_count": 1,
  16. "user_id": 1,
  17. "user_name": "汪小嘉"
  18. }
  19. ]
  20. }
  21. 没有数据返回时候
  22. {
  23. "status": 1,
  24. "data": {},
  25. "msg": "员工不存在"
  26. }