需求描述
1、客户统计模块: 展示客户的服务次数(包含小的拜访记录次数与单条大拜访记录)、总支出情况、是否签约、签约合同金额客户id2、员工统计模块:员工服务过的客户(参与过的都包含在内)、员工服务次数、签约合同次数、员工id
接口设计
客户统计接口
功能
根据客户id、单位id,展示客户的服务次数(包含小的拜访记录次数与单条大拜访记录)、总支出情况、是否签约、签约合同金额
客户的跟进情况
地址
/api/stats/customer
请求方法
GET
参数说明
| 名称 | 类型 | 说明 | 备注 | 是否必须 |
|---|---|---|---|---|
| organization_id | int | 客户单位id | 否,默认所有 | |
| start_time | string | 开始时间:2020-01-01 00:00:00 | 否,默认全部 | |
| end_time | string | 结束时间:2021-01-01 00:00:00 | 否,默认全部 |
返回格式
{"status": 0,"data": [[{"organization_id": 1,"potential_count": 3,"follow_cost": 26.0,"follow_count": 3,"contract_amount": 24000.0,"contract_count": 1,"customer_status": 2,"organization_name": "耳尖团队"},{"organization_id": 2,"potential_count": 1,"follow_cost": 50.0,"follow_count": 1,"contract_amount": 0.0,"contract_count": 0,"customer_status": 1,"organization_name": "微舆"}]]}
员工统计接口
功能
员工服务过的客户(参与过的都包含在内)、员工服务次数、签约合同次数
员工对客户的跟进、对接情况
地址
/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 | 否,默认全部 |
返回格式
{"status": 0,"data": [{"contract_count": 1,"contract_amount": 24000.0,"customer_info": [{"organization_id": 1,"follow_cost": 26.0,"follow_count": 3,"customer_status": 2}],"organization_count": 1,"user_id": 1,"user_name": "汪小嘉"}]}没有数据返回时候{"status": 1,"data": {},"msg": "员工不存在"}
