|
@@ -371,6 +371,7 @@ func GetIncomeList(condition string, pars []interface{}, startSize, pageSize int
|
|
|
|
|
|
// 增量客户统计报表列表数据结构
|
|
|
type IncrementalList struct {
|
|
|
+ Id int `description:"合同id"`
|
|
|
CompanyContractId int `description:"合同id"`
|
|
|
ContractType string `description:"合同类型"`
|
|
|
CompanyId int `description:"企业客户id"`
|
|
@@ -415,6 +416,7 @@ type IncrementalList struct {
|
|
|
SellerIdLast int `description:"合同到期之前最后所属销售ID"`
|
|
|
ShareSellerInit string `description:"共享销售员"`
|
|
|
Operation string `description:"共享销售员"`
|
|
|
+ SysUserId int `description:"操作人用户id"`
|
|
|
}
|
|
|
|
|
|
// GetIncrementalNewCompanyCount 获取增量客户报表列表统计数据(根据合同来展示)
|
|
@@ -828,8 +830,58 @@ func GetIncrementalCompanyListByOperationRecordIniut(condition string, pars []in
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
AND c.product_id = 2
|
|
|
- AND a.create_time >= '2024-10-01'
|
|
|
- AND a.create_time <= '2024-12-31'
|
|
|
+ AND a.create_time >= '2024-01-01'
|
|
|
+ AND a.create_time < '2024-07-01'
|
|
|
+ AND a.operation IN ( 'add', 'receive' )
|
|
|
+ GROUP BY
|
|
|
+ a.company_id, a.product_id`
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// GetIncrementalCompanyListByOperationRecord 获取试用客户报表列表数据(根据新增客户时间来展示)
|
|
|
+func GetIncrementalCompanyListByOperationRecordIniut3(condition string, pars []interface{}, startSize, pageSize int) (items []*IncrementalList, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+
|
|
|
+ //查询真正的数据
|
|
|
+ sql := `SELECT
|
|
|
+ a.*,
|
|
|
+ b.company_name
|
|
|
+ FROM
|
|
|
+ company_operation_record a
|
|
|
+ RIGHT JOIN company b ON a.company_id = b.company_id
|
|
|
+ JOIN company_product c ON b.company_id = c.company_id
|
|
|
+ AND a.product_id = c.product_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND c.product_id = 2
|
|
|
+ AND a.create_time >= '2023-07-01'
|
|
|
+ AND a.create_time <= '2023-09-30'
|
|
|
+ AND a.operation IN ( 'add', 'receive' )
|
|
|
+ GROUP BY
|
|
|
+ a.company_id, a.product_id`
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// GetIncrementalCompanyListByOperationRecord 获取试用客户报表列表数据(根据新增客户时间来展示)
|
|
|
+func GetIncrementalCompanyListByOperationRecordIniut4(condition string, pars []interface{}, startSize, pageSize int) (items []*IncrementalList, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+
|
|
|
+ //查询真正的数据
|
|
|
+ sql := `SELECT
|
|
|
+ a.*,
|
|
|
+ b.company_name
|
|
|
+ FROM
|
|
|
+ company_operation_record a
|
|
|
+ RIGHT JOIN company b ON a.company_id = b.company_id
|
|
|
+ JOIN company_product c ON b.company_id = c.company_id
|
|
|
+ AND a.product_id = c.product_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND c.product_id = 2
|
|
|
+ AND a.create_time >= '2023-10-01'
|
|
|
+ AND a.create_time <= '2023-12-31'
|
|
|
AND a.operation IN ( 'add', 'receive' )
|
|
|
GROUP BY
|
|
|
a.company_id, a.product_id`
|