Jelajahi Sumber

fix_定向邀约列表计数

Ethan 2 minggu lalu
induk
melakukan
2ba2369d9e

+ 1 - 0
app/service/cooperation_service.go

@@ -263,6 +263,7 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 			}
 			enterpriseSupplierCooperates = resEnterpriseSuppliers
 		}
+		total = int64(len(enterpriseSupplierCooperates))
 	} else if param.Status == 2 { // 邀约中
 		if param.TaskType == 2 {
 			// 品牌种草

+ 12 - 0
app/service/local_life_service.go

@@ -973,6 +973,18 @@ func (s LocalLifeService) GetLocalLifeTaskList(param *vo.LocalSearchParam) (vo.R
 		reLocalTaskPreviews[i].StoreName = storeName
 		reLocalTaskPreviews[i].StoreLocation = storeLocation
 		reLocalTaskPreviews[i].MainImage = mainImage
+
+		if param.LocalType == 2 {
+			paramTemp := &vo.SupplierSearchInTargetTaskParam{}
+			paramTemp.EnterpriseId = param.EnterpriseId
+			paramTemp.SubAccountId = param.SubAccountId
+			paramTemp.TaskId = param.LocalId
+			paramTemp.TaskType = 3
+			res := CooperationService{}.GetSupplierInTargetCount(paramTemp)
+			reLocalTaskPreviews[i].InvitableNum = res["invitableNum"]
+			reLocalTaskPreviews[i].InvitingNum = res["invitingNum"]
+			reLocalTaskPreviews[i].CooperatingNum = res["cooperatingNum"]
+		}
 	}
 	result = vo.ResultVO{
 		Page:     param.Page,

+ 12 - 0
app/service/project_service.go

@@ -932,6 +932,18 @@ func (s ProjectService) GetProjectTaskList(param *vo.ProjectSearchParam) (vo.Res
 		reProjectTaskPreviews[i].ProductName = productName
 		reProjectTaskPreviews[i].ProductPrice = productPrice
 		reProjectTaskPreviews[i].MainImage = mainImage
+
+		if param.ProjectType == 2 {
+			paramTemp := &vo.SupplierSearchInTargetTaskParam{}
+			paramTemp.EnterpriseId = param.EnterpriseId
+			paramTemp.SubAccountId = param.SubAccountId
+			paramTemp.TaskId = param.ProjectId
+			paramTemp.TaskType = 2
+			res := CooperationService{}.GetSupplierInTargetCount(paramTemp)
+			reProjectTaskPreviews[i].InvitableNum = res["invitableNum"]
+			reProjectTaskPreviews[i].InvitingNum = res["invitingNum"]
+			reProjectTaskPreviews[i].CooperatingNum = res["cooperatingNum"]
+		}
 	}
 	result = vo.ResultVO{
 		Page:     param.Page,

+ 18 - 15
app/vo/re_local_task_preview.go

@@ -8,19 +8,22 @@ type ReLocalTaskPreview struct {
 	TeamBuyingId  int64  `json:"teamBuyingId"`
 	LocalName     string `json:"localName"`
 
-	EnterpriseId  string  `json:"enterpriseId"`
-	SubAccountId  int64   `json:"subAccountId"`
-	LocalId       string  `json:"localId"`
-	LocalPlatform int64   `json:"localPlatform"`
-	LocalStatus   int64   `json:"localStatus"`
-	EstimatedCost float64 `json:"estimatedCost"` // 任务成本
-	LocalForm     int64   `json:"localForm"`
-	ContentType   int64   `json:"contentType"`
-	NeedReview    int64   `json:"needReview"`
-	NeedQuality   int64   `json:"needQuality"`
-	NeedCalculate int64   `json:"needCalculate"`
-	CreatorName   string  `json:"creatorName"`
-	LocalType     int64   `json:"localType"`
-	CreatedAt     string  `json:"createdAt"`
-	Tools         string  `json:"tools"`
+	EnterpriseId   string  `json:"enterpriseId"`
+	SubAccountId   int64   `json:"subAccountId"`
+	LocalId        string  `json:"localId"`
+	LocalPlatform  int64   `json:"localPlatform"`
+	LocalStatus    int64   `json:"localStatus"`
+	EstimatedCost  float64 `json:"estimatedCost"` // 任务成本
+	LocalForm      int64   `json:"localForm"`
+	ContentType    int64   `json:"contentType"`
+	NeedReview     int64   `json:"needReview"`
+	NeedQuality    int64   `json:"needQuality"`
+	NeedCalculate  int64   `json:"needCalculate"`
+	CreatorName    string  `json:"creatorName"`
+	LocalType      int64   `json:"localType"`
+	CreatedAt      string  `json:"createdAt"`
+	Tools          string  `json:"tools"`
+	InvitableNum   int64   `json:"invitableNum"`
+	InvitingNum    int64   `json:"invitingNum"`
+	CooperatingNum int64   `json:"cooperatingNum"`
 }

+ 3 - 0
app/vo/re_project_task_preview.go

@@ -26,4 +26,7 @@ type ReProjectTaskPreview struct {
 	ProjectType     int64   `json:"projectType"`
 	CreatedAt       string  `json:"createdAt"`
 	Tools           string  `json:"tools"`
+	InvitableNum    int64   `json:"invitableNum"`
+	InvitingNum     int64   `json:"invitingNum"`
+	CooperatingNum  int64   `json:"cooperatingNum"`
 }