Browse Source

Merge branch 'crm/crm_16.7' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

zhangchuanxing 1 week ago
parent
commit
f1939ab066

+ 13 - 5
controllers/statistic/rai_data_summary.go

@@ -404,6 +404,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
 	fmt.Println(startDate)
 	fmt.Println(endDate)
 	resp := new(statistic_report.RaiDataSummaryPopupTypeResp)
+	var listResp []*statistic_report.RaiDataSummaryDetailResp
 	var trialTotal int
 	switch popupType {
 	case "新增试用":
@@ -433,18 +434,25 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
 		}
 		if len(tryList) > 0 {
 			for _, v := range tryList {
+				item := new(statistic_report.RaiDataSummaryDetailResp)
 				v.SellerName = v.SysRealName
 				if v.Operation == "add" {
-					v.Operation = "新建"
+					item.AddType = "新建"
 				} else if v.Operation == "receive" || v.Operation == "apply_receive" {
-					v.Operation = "领取"
+					item.AddType = "领取"
 				}
+				item.CompanyName = v.CompanyName
+				item.SellerName = v.SellerName
+				item.CreateTime = v.CreateTime
+				listResp = append(listResp, item)
 			}
-			resp.AddTrialItem.List = tryList
-		} else {
-			resp.AddTrialItem.List = make([]*models.IncrementalList, 0)
 		}
 	}
+
+	if len(listResp) == 0 {
+		listResp = make([]*statistic_report.RaiDataSummaryDetailResp, 0)
+	}
+	resp.List = listResp
 	page := paging.GetPaging(currentIndex, pageSize, trialTotal)
 	resp.Paging = page
 	br.Ret = 200

+ 8 - 5
models/statistic_report/rai_data_summary.go

@@ -3,7 +3,6 @@ package statistic_report
 import (
 	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
-	"hongze/hz_crm_api/models"
 	"hongze/hz_crm_api/models/company"
 )
 
@@ -119,10 +118,14 @@ func GetRaiDataSummaryList(condition string, pars []interface{}) (items []*Incre
 }
 
 type RaiDataSummaryPopupTypeResp struct {
-	Paging       *paging.PagingItem `description:"分页数据"`
-	AddTrialItem AddTrialItem       `description:"新增试用"`
+	Paging *paging.PagingItem          `description:"分页数据"`
+	List   []*RaiDataSummaryDetailResp `description:"列表"`
 }
 
-type AddTrialItem struct {
-	List []*models.IncrementalList
+// 增量客户统计报表列表数据结构
+type RaiDataSummaryDetailResp struct {
+	CompanyName string `description:"企业客户名称"`
+	SellerName  string `description:"归属销售名称"`
+	AddType     string `description:"新增类型"`
+	CreateTime  string `description:"创建时间"`
 }