|
@@ -130,6 +130,23 @@ func (this *OverseasCustomController) CustomList() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ statisticsDataStatusList := make([]*overseas_custom.CustomTotal, 0)
|
|
|
|
+ statisticsDataMap := make(map[string]int)
|
|
|
|
+ for _, v := range statisticsDataList {
|
|
|
|
+ statisticsDataMap[v.CompanyStatus] = v.Total
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var statusArr = [3]string{"试用", "正式", "关闭"}
|
|
|
|
+
|
|
|
|
+ for _, v := range statusArr {
|
|
|
|
+ item := new(overseas_custom.CustomTotal)
|
|
|
|
+ item.CompanyStatus = v
|
|
|
|
+ if val, ok := statisticsDataMap[v]; ok {
|
|
|
|
+ item.Total = val
|
|
|
|
+ }
|
|
|
|
+ statisticsDataStatusList = append(statisticsDataStatusList, item)
|
|
|
|
+ }
|
|
|
|
+
|
|
overseasLabelDataList, err := obj.GetCustomOverseasLabelTotal(condition, pars)
|
|
overseasLabelDataList, err := obj.GetCustomOverseasLabelTotal(condition, pars)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取失败"
|
|
br.Msg = "获取失败"
|
|
@@ -137,13 +154,31 @@ func (this *OverseasCustomController) CustomList() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ labelDataMap := make(map[int]int)
|
|
|
|
+ for _, v := range overseasLabelDataList {
|
|
|
|
+ labelDataMap[v.OverseasLabel] = v.Total
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var labelArr = [4]int{1, 2, 3, 4}
|
|
|
|
+
|
|
|
|
+ labelList := make([]*overseas_custom.OverseasLabelTotal, 0)
|
|
|
|
+
|
|
|
|
+ for _, v := range labelArr {
|
|
|
|
+ item := new(overseas_custom.OverseasLabelTotal)
|
|
|
|
+ item.OverseasLabel = v
|
|
|
|
+ if val, ok := labelDataMap[v]; ok {
|
|
|
|
+ item.Total = val
|
|
|
|
+ }
|
|
|
|
+ labelList = append(labelList, item)
|
|
|
|
+ }
|
|
|
|
+
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
|
|
|
resp := new(overseas_custom.CustomListResp)
|
|
resp := new(overseas_custom.CustomListResp)
|
|
resp.Paging = page
|
|
resp.Paging = page
|
|
resp.List = list
|
|
resp.List = list
|
|
- resp.StatisticsData = statisticsDataList
|
|
|
|
- resp.OverseasLabelData = overseasLabelDataList
|
|
|
|
|
|
+ resp.StatisticsData = statisticsDataStatusList
|
|
|
|
+ resp.OverseasLabelData = labelList
|
|
|
|
|
|
br.Ret = 200
|
|
br.Ret = 200
|
|
br.Success = true
|
|
br.Success = true
|