Explorar o código

[20250724]达人库

lin-jim-leon hai 1 semana
pai
achega
78040f8efa

+ 44 - 0
app/controller/cooperation_controller.go

@@ -109,6 +109,32 @@ func (o CooperationController) GetSupplierCount(c *gin.Context) {
 	returnSuccess(c, 20000, result)
 }
 
+// 达人管理-达人数据卡
+func (o CooperationController) GetTalentData(c *gin.Context) {
+	param := &vo.TalentDataParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result := service.CooperationService{}.GetTalentData(param)
+	returnSuccess(c, 20000, result)
+}
+
+// 达人管理-合作数据
+func (o CooperationController) GetCoopTalentData(c *gin.Context) {
+	param := &vo.TalentDataParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result := service.CooperationService{}.GetCoopTalentData(param)
+	returnSuccess(c, 20000, result)
+}
+
 // 服务商管理-服务商数据卡
 func (o CooperationController) GetSupplierData(c *gin.Context) {
 	param := &vo.SupplierDataParam{}
@@ -123,6 +149,24 @@ func (o CooperationController) GetSupplierData(c *gin.Context) {
 	returnSuccess(c, 20000, result)
 }
 
+// 达人管理-达人数据卡列表
+func (o CooperationController) GetTalentPerform(c *gin.Context) {
+	param := &vo.TalentDataParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result, err := service.CooperationService{}.GetTalentPerform(param)
+	if err != nil {
+		logrus.Errorf("[GetTalentPerform] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
 // 服务商管理-服务商数据卡列表
 func (o CooperationController) GetSupplierPerform(c *gin.Context) {
 	param := &vo.SupplierDataParam{}

+ 93 - 0
app/dao/local_life_task_info_dao.go

@@ -21,6 +21,29 @@ func (d LocalLifeTaskInfoDao) CountByTaskStage(localId string, taskStage int64)
 	return total
 }
 
+// 根据openid获取报名的本地生活子任务阶段
+func (d LocalLifeTaskInfoDao) CountAllByOpenid(openid string) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeTaskInfo{}).Where("open_id = ?", openid).Count(&total)
+	return total
+}
+
+// 根据openid获取指定任务阶段的本地生活子任务阶段
+func (d LocalLifeTaskInfoDao) CountByOpenid(openid string, taskStage int) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeTaskInfo{}).Where("open_id = ? AND task_stage = ?", openid, taskStage).Count(&total)
+	return total
+}
+
+// 根据openid获取执行中的本地生活子任务阶段
+func (d LocalLifeTaskInfoDao) CountExcuteNumByOpenid(openid string) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeTaskInfo{}).
+		Where("open_id = ? AND task_stage NOT IN (?)", openid, []int{1, 3, 15, 16, 17}).
+		Count(&total)
+	return total
+}
+
 // 获取指定任务阶段的本地生活子任务
 func (d LocalLifeTaskInfoDao) GetListByTaskStage(localId string, taskStage int64, time string, page int, pageSize int) ([]*entity.LocalLifeTaskInfo, int64, error) {
 	var taskInfos []*entity.LocalLifeTaskInfo
@@ -168,3 +191,73 @@ func (d LocalLifeTaskInfoDao) UpdateLocalStatus(taskIds []string, localLifeTaskI
 	}
 	return nil
 }
+
+func (d LocalLifeTaskInfoDao) GetLocalLifeInfoByTalentId(talentid string, others string, sortField []string, sortOrder []string, page int, pageSize int, reltype int, enterpriseid string, platform int) ([]*entity.LocalLifeTaskInfo, int64, error) {
+	projectTaskInfos := []*entity.LocalLifeTaskInfo{}
+	var total int64
+
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).
+		Joins("JOIN younggee_local_life_info ylli ON ylli.local_id = youngee_local_task_info.local_id").
+		Where("youngee_local_task_info.talent_id = ? AND youngee_local_task_info.task_stage = ? AND youngee_local_task_info.platform_id = ?", talentid, 15, platform)
+
+	// 搜索条件(local_name)
+	if others != "" {
+		query = query.Where("ylli.local_name LIKE ?", "%"+others+"%")
+	}
+
+	if reltype == 2 {
+		query = query.Where("ylli.enterprise_id = ?", enterpriseid)
+	}
+
+	// 排序处理
+	if len(sortField) > 0 && len(sortOrder) > 0 && len(sortField) == len(sortOrder) {
+		for i := 0; i < len(sortField); i++ {
+			sortfield := sortField[i]
+			sortorder := sortOrder[i]
+			switch sortfield {
+			case "commit_avg":
+				if sortorder == "asc" {
+					query = query.Order("youngee_local_task_info.commit_avg asc")
+				} else {
+					query = query.Order("youngee_local_task_info.commit_avg desc")
+				}
+			case "collect_num":
+				if sortorder == "asc" {
+					query = query.Order("youngee_local_task_info.collect_num asc")
+				} else {
+					query = query.Order("youngee_local_task_info.collect_num desc")
+				}
+			case "vote_avg":
+				if sortorder == "asc" {
+					query = query.Order("youngee_local_task_info.vote_avg asc")
+				} else {
+					query = query.Order("youngee_local_task_info.vote_avg desc")
+				}
+
+			}
+		}
+	}
+	// 获取总数
+	if err := query.Count(&total).Error; err != nil {
+		return nil, 0, err
+	}
+
+	// 选择字段(明确指定表名)
+	query = query.Select(`
+        youngee_local_task_info.local_id, 
+        youngee_local_task_info.task_id, 
+        ylli.local_name, 
+        youngee_local_task_info.commit_avg,
+		youngee_local_task_info.collect_num,
+		youngee_local_task_info.vote_avg,`)
+
+	// 分页查询
+	offset := (page - 1) * pageSize
+	err := query.Offset(offset).Limit(pageSize).Find(&projectTaskInfos).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return projectTaskInfos, total, nil
+
+}

+ 15 - 0
app/dao/platform_kuaishou_user_info_dao.go

@@ -18,3 +18,18 @@ func (d PlatformKuaishouUserInfoDao) GetUserInfo(openId string) (entity.Platform
 	}
 	return userInfo, nil
 }
+
+func (d PlatformKuaishouUserInfoDao) GetUserInfoById(id string) (entity.PlatformKuaishouUserInfo, error) {
+	var userInfo entity.PlatformKuaishouUserInfo
+	err := Db.First(&userInfo, "id = ?", id).Error
+	if err != nil {
+		userInfo.OpenID = id
+		userInfo.NickName = ""
+		userInfo.HeadUri = ""
+		userInfo.City = ""
+		userInfo.Gender = ""
+		userInfo.LikeNum = 0
+		userInfo.VideoNum = 0
+	}
+	return userInfo, nil
+}

+ 101 - 0
app/dao/project_task_info_dao.go

@@ -21,6 +21,29 @@ func (d ProjectTaskInfoDao) CountByTaskStage(projectId string, taskStage int64)
 	return total
 }
 
+// 根据openid获取报名的种草子任务阶段
+func (d ProjectTaskInfoDao) CountAllByOpenid(openid string) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).Where("open_id = ?", openid).Count(&total)
+	return total
+}
+
+// 根据openid获取指定任务阶段的种草子任务阶段
+func (d ProjectTaskInfoDao) CountByOpenid(openid string, taskStage int) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).Where("open_id = ? AND task_stage = ?", openid, taskStage).Count(&total)
+	return total
+}
+
+// 根据openid获取执行中的种草子任务阶段
+func (d ProjectTaskInfoDao) CountExcuteNumByOpenid(openid string) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).
+		Where("open_id = ? AND task_stage NOT IN (?)", openid, []int{1, 3, 15, 16, 17}).
+		Count(&total)
+	return total
+}
+
 // 获取指定任务阶段的种草子任务
 func (d ProjectTaskInfoDao) GetListByTaskStage(projectId string, taskStage int64, time string, page int, pageSize int, talentNickname string) ([]*entity.ProjectTaskInfo, int64, error) {
 	var taskInfos []*entity.ProjectTaskInfo
@@ -152,3 +175,81 @@ func (d ProjectTaskInfoDao) UpdateFieldBatch(taskIds []string, updateData map[st
 	}
 	return nil
 }
+
+func (d ProjectTaskInfoDao) GetProjectInfoByTalentId(talentid string, others string, sortField []string, sortOrder []string, page int, pageSize int, reltype int, enterpriseid string, platform int) ([]*entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []*entity.ProjectTaskInfo{}
+	var total int64
+
+	query := Db.Model(&entity.ProjectTaskInfo{}).
+		Joins("JOIN project_info pi ON pi.project_id = youngee_task_info.project_id").
+		Where("youngee_task_info.talent_id = ? AND youngee_task_info.task_stage = ? AND youngee_task_info.platform_id = ?", talentid, 15, platform)
+
+	// 搜索条件(针对project_name)
+	if others != "" {
+		query = query.Where("pi.project_name LIKE ?", "%"+others+"%")
+	}
+
+	if reltype == 2 {
+		query = query.Where("pi.enterprise_id = ?", enterpriseid)
+	}
+
+	// 排序处理
+	if len(sortField) > 0 && len(sortOrder) > 0 && len(sortField) == len(sortOrder) {
+		for i := 0; i < len(sortField); i++ {
+			sortfield := sortField[i]
+			sortorder := sortOrder[i]
+			switch sortfield {
+			case "commit_avg":
+				if sortorder == "asc" {
+					query = query.Order("youngee_task_info.commit_avg asc")
+				} else {
+					query = query.Order("youngee_task_info.commit_avg desc")
+				}
+			case "collect_num":
+				if sortorder == "asc" {
+					query = query.Order("youngee_task_info.collect_num asc")
+				} else {
+					query = query.Order("youngee_task_info.collect_num desc")
+				}
+			case "vote_avg":
+				if sortorder == "asc" {
+					query = query.Order("youngee_task_info.vote_avg asc")
+				} else {
+					query = query.Order("youngee_task_info.vote_avg desc")
+				}
+			case "view_num":
+				if sortorder == "asc" {
+					query = query.Order("youngee_task_info.view_num asc")
+				} else {
+					query = query.Order("youngee_task_info.view_num desc")
+				}
+			}
+
+		}
+	}
+
+	// 获取总数
+	if err := query.Count(&total).Error; err != nil {
+		return nil, 0, err
+	}
+
+	// 选择字段(明确指定表名)
+	query = query.Select(`
+        youngee_task_info.project_id, 
+        youngee_task_info.task_id, 
+        pi.project_name, 
+        youngee_task_info.commit_avg,
+		youngee_task_info.collect_num,
+		youngee_task_info.vote_avg,
+		youngee_task_info.view_num
+    `)
+
+	// 分页查询
+	offset := (page - 1) * pageSize
+	err := query.Offset(offset).Limit(pageSize).Find(&projectTaskInfos).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return projectTaskInfos, total, nil
+}

+ 80 - 0
app/dao/sec_task_info_dao.go

@@ -12,6 +12,29 @@ func (s SelectionTaskInfoDao) CountBySelectionId(selectionId string) (int64, err
 	return count, err
 }
 
+// 根据openid获取报名的带货子任务阶段
+func (d SelectionTaskInfoDao) CountAllByOpenid(openid string) int64 {
+	var total int64
+	Db.Model(&entity.SelectionTaskInfo{}).Where("open_id = ?", openid).Count(&total)
+	return total
+}
+
+// 根据openid获取指定任务阶段的带货子任务阶段
+func (d SelectionTaskInfoDao) CountByOpenid(openid string, taskStage int) int64 {
+	var total int64
+	Db.Model(&entity.SelectionTaskInfo{}).Where("open_id = ? AND task_stage = ?", openid, taskStage).Count(&total)
+	return total
+}
+
+// 根据openid获取执行中的带货子任务阶段
+func (d SelectionTaskInfoDao) CountExcuteNumByOpenid(openid string) int64 {
+	var total int64
+	Db.Model(&entity.SelectionTaskInfo{}).
+		Where("open_id = ? AND task_stage NOT IN (?)", openid, []int{1, 2, 3, 5, 10}).
+		Count(&total)
+	return total
+}
+
 // 获取带货子任务中指定悬赏阶段的数据
 func (s SelectionTaskInfoDao) GetRewardDetailByRewardStage(selectionId string, rewardStage int64, order int64, page int, pageSize int) ([]*entity.SelectionTaskInfo, int64, error) {
 	selectionTaskInfos := []*entity.SelectionTaskInfo{}
@@ -32,3 +55,60 @@ func (s SelectionTaskInfoDao) GetRewardDetailByRewardStage(selectionId string, r
 
 	return selectionTaskInfos, total, nil
 }
+
+func (s SelectionTaskInfoDao) GetSecInfoByOpenId(talentid string, others string, sortField []string, sortOrder []string, page int, pageSize int, reltype int, enterpriseid string) ([]*entity.SelectionTaskInfo, int64, error) {
+	selectionTaskInfos := []*entity.SelectionTaskInfo{}
+	var total int64
+
+	// 正确JOIN younggee_selection_info表
+	query := Db.Model(&entity.SelectionTaskInfo{}).
+		Joins("JOIN younggee_selection_info ysi ON ysi.selection_id = selection_task_info.selection_id").
+		Where("selection_task_info.talent_id = ? AND selection_task_info.task_stage = ? ", talentid, 10)
+
+	// 搜索条件(针对selection_name)
+	if others != "" {
+		query = query.Where("ysi.selection_name LIKE ?", "%"+others+"%")
+	}
+
+	if reltype == 2 {
+		query = query.Where("ysi.enterprise_id = ?", enterpriseid)
+	}
+
+	// 排序处理
+	if len(sortField) > 0 && len(sortOrder) > 0 && len(sortField) == len(sortOrder) {
+		for i := 0; i < len(sortField); i++ {
+			sortfield := sortField[i]
+			sortorder := sortOrder[i]
+			switch sortfield {
+			case "sale_actual":
+				if sortorder == "asc" {
+					query = query.Order("selection_task_info.sale_actual asc")
+				} else {
+					query = query.Order("selection_task_info.sale_actual desc")
+				}
+			}
+		}
+	}
+
+	// 获取总数
+	if err := query.Count(&total).Error; err != nil {
+		return nil, 0, err
+	}
+
+	// 选择字段(明确指定表名)
+	query = query.Select(`
+        selection_task_info.selection_id, 
+        selection_task_info.task_id, 
+        ysi.selection_name, 
+        selection_task_info.sale_actual
+    `)
+
+	// 分页查询
+	offset := (page - 1) * pageSize
+	err := query.Offset(offset).Limit(pageSize).Find(&selectionTaskInfos).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return selectionTaskInfos, total, nil
+}

+ 1 - 0
app/entity/local_life_task_info.go

@@ -80,6 +80,7 @@ type LocalLifeTaskInfo struct {
 	ReserveTime            time.Time `gorm:"column:reserve_time"`                         // 预约探店时间
 	ExploreTime            time.Time `gorm:"column:explore_time"`                         // 探店时间
 	FinishExploreTime      time.Time `gorm:"column:finish_explore_time"`                  // 完成探店时间
+	CollectNum             int       `gorm:"column:collect_num"`
 }
 
 func (m *LocalLifeTaskInfo) TableName() string {

+ 5 - 0
app/entity/project_task_info.go

@@ -57,6 +57,11 @@ type ProjectTaskInfo struct {
 	CancelOperator         string    `gorm:"column:cancel_operator"`
 	TalentName             string    `gorm:"column:talent_name"`
 	OpenID                 string    `gorm:"column:open_id"` // 达人报名的唯一标识
+	ViewNum                int       `gorm:"column:view_num"`
+	VoteAvg                int       `gorm:"column:vote_avg"`
+	CollectNum             int       `gorm:"column:collect_num"`
+	CommitAvg              int       `gorm:"column:commit_avg"`
+	PlatformId             int       `gorm:"column:platform_id"`
 }
 
 func (m *ProjectTaskInfo) TableName() string {

+ 1 - 0
app/entity/talent_info.go

@@ -32,6 +32,7 @@ type YoungeeTalentInfo struct {
 	ApplyNum          int64     `gorm:"column:apply_num;default:5;NOT NULL"` // 剩余申请次数(每天更新)
 	UserType          int64     `gorm:"column:user_type"`
 	Sex               int64     `gorm:"column:sex"`
+	WxNum             string    `gorm:"column:wx_num"`
 }
 
 func (m *YoungeeTalentInfo) TableName() string {

+ 191 - 0
app/service/cooperation_service.go

@@ -210,6 +210,86 @@ func (t CooperationService) GetSupplierCount(param *vo.SupplierConfirmingParam)
 	return res
 }
 
+// 达人合作数据
+func (t CooperationService) GetCoopTalentData(param *vo.TalentDataParam) vo.ReTalentCoopData {
+	var res vo.ReTalentCoopData
+	talent, err1 := dao.TalentInfoDao{}.GetTalentInfo(param.TalentId)
+	user, err2 := dao.PlatformKuaishouUserInfoDao{}.GetUserInfoById(param.PlatFormUserId)
+	if err1 != nil && err2 != nil {
+		return vo.ReTalentCoopData{}
+	}
+	talentDataPreview := &vo.TalentDataPreview{
+		TalentId:   talent.ID,
+		AvatarUrl:  user.HeadUri,
+		Sex:        user.Gender,
+		TalentName: user.NickName,
+		WXAccount:  talent.WxNum,
+		Phone:      talent.TalentPhoneNumber,
+		Skill:      user.Skill,
+		OpenId:     user.OpenID,
+	}
+	res.TalentDataPreview = talentDataPreview
+	var applynum, executenum, endnum int64
+	executenum = dao.ProjectTaskInfoDao{}.CountExcuteNumByOpenid(user.OpenID)
+	applynum = dao.ProjectTaskInfoDao{}.CountAllByOpenid(user.OpenID)
+	endnum = dao.ProjectTaskInfoDao{}.CountByOpenid(user.OpenID, 15)
+
+	executenum += dao.SelectionTaskInfoDao{}.CountExcuteNumByOpenid(user.OpenID)
+	applynum += dao.SelectionTaskInfoDao{}.CountAllByOpenid(user.OpenID)
+	endnum += dao.SelectionTaskInfoDao{}.CountByOpenid(user.OpenID, 10)
+
+	executenum += dao.LocalLifeTaskInfoDao{}.CountExcuteNumByOpenid(user.OpenID)
+	applynum += dao.LocalLifeTaskInfoDao{}.CountAllByOpenid(user.OpenID)
+	endnum += dao.LocalLifeTaskInfoDao{}.CountByOpenid(user.OpenID, 15)
+
+	coopdata := &vo.TalentCoopData{
+		SignTaskNum:     applynum,
+		SelectedTaskNum: endnum + executenum,
+		PerformTaskNum:  executenum,
+		CompleteTaskNum: endnum,
+	}
+	res.TalentCoopData = coopdata
+	return res
+}
+
+// 达人数据
+func (t CooperationService) GetTalentData(param *vo.TalentDataParam) vo.ReTalentData {
+	var res vo.ReTalentData
+	talent, err1 := dao.TalentInfoDao{}.GetTalentInfo(param.TalentId)
+	user, err2 := dao.PlatformKuaishouUserInfoDao{}.GetUserInfoById(param.PlatFormUserId)
+	if err1 != nil && err2 != nil {
+		return vo.ReTalentData{}
+	}
+	talentDataPreview := &vo.TalentDataPreview{
+		TalentId:   talent.ID,
+		AvatarUrl:  user.HeadUri,
+		Sex:        user.Gender,
+		TalentName: user.NickName,
+		WXAccount:  talent.WxNum,
+		Phone:      talent.TalentPhoneNumber,
+		Skill:      user.Skill,
+		OpenId:     user.OpenID,
+	}
+	res.TalentDataPreview = talentDataPreview
+	var avgLikeNum float64
+	if user.VideoNum != 0 {
+		avgLikeNum = float64(user.LikeNum) / float64(user.VideoNum)
+	} else {
+		avgLikeNum = 0
+	}
+	coreData := &vo.TalentCoreData{
+		FansNum:       user.Fan,
+		AvgLikeNum:    avgLikeNum,
+		AvgCollect:    0,
+		AvgComment:    0,
+		ThirtySaleNum: 0,
+		SixtySaleNum:  0,
+		NinetySaleNum: 0,
+	}
+	res.TalentCoreData = coreData
+	return res
+}
+
 // 服务商管理-服务商数据卡
 func (t CooperationService) GetSupplierData(param *vo.SupplierDataParam) vo.ReSupplierCoopData {
 	var reSupplierCoopData vo.ReSupplierCoopData
@@ -266,6 +346,117 @@ func (t CooperationService) GetSupplierData(param *vo.SupplierDataParam) vo.ReSu
 	return reSupplierCoopData
 }
 
+// 达人管理-达人数据卡列表
+func (t CooperationService) GetTalentPerform(param *vo.TalentDataParam) (vo.ResultVO, error) {
+	if param.Page <= 0 {
+		param.Page = 1
+	}
+	if param.PageSize <= 0 {
+		param.PageSize = 10
+	}
+	var talentDataParams []*vo.TalentPerformance
+	var total int64
+	result := vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     talentDataParams,
+	}
+	//带货
+	if param.TaskType == 1 {
+		sectasks, total1, err1 := dao.SelectionTaskInfoDao{}.GetSecInfoByOpenId(param.TalentId, param.Others, param.SortField, param.SortOrder, param.Page, param.PageSize, param.RelType, param.EnterpriseId)
+		total = total1
+		if err1 != nil {
+			return result, err1
+		}
+		for _, sectask := range sectasks {
+			var perform vo.TalentPerformance
+			secid := sectask.SelectionID
+			sec, err2 := dao.SelectionInfoDAO{}.GetSelectionInfoById(secid)
+			if err2 != nil {
+				return result, err2
+			}
+			var product entity.Product
+			var productMainPhoto entity.ProductPhoto
+			err11 := json.Unmarshal([]byte(sec.ProductSnap), &product)
+			err12 := json.Unmarshal([]byte(sec.ProductPhotoSnap), &productMainPhoto)
+			if err11 != nil || err12 != nil {
+				perform.MainImage = productMainPhoto.PhotoUrl
+				perform.ProductName = product.ProductName
+				perform.Price = product.ProductPrice
+				perform.Category = product.ProductCategory
+				perform.SalesNum = sectask.SaleActual
+			}
+			talentDataParams = append(talentDataParams, &perform)
+		}
+	} else if param.TaskType == 2 {
+		prjtasks, total2, err2 := dao.ProjectTaskInfoDao{}.GetProjectInfoByTalentId(param.TalentId, param.Others, param.SortField, param.SortOrder, param.Page, param.PageSize, param.RelType, param.EnterpriseId, param.Platform)
+		total = total2
+		if err2 != nil {
+			return result, err2
+		}
+		for _, sectask := range prjtasks {
+			var perform vo.TalentPerformance
+			secid := sectask.ProjectID
+			sec, err2 := dao.ProjectDAO{}.GetProjectById(secid)
+			if err2 != nil {
+				return result, err2
+			}
+			var product entity.Product
+			var productMainPhoto entity.ProductPhoto
+			err11 := json.Unmarshal([]byte(sec.ProductSnap), &product)
+			err12 := json.Unmarshal([]byte(sec.ProductPhotoSnap), &productMainPhoto)
+			if err11 != nil || err12 != nil {
+				perform.MainImage = productMainPhoto.PhotoUrl
+				perform.ProductName = product.ProductName
+				perform.Price = product.ProductPrice
+				perform.VoteCount = sectask.VoteAvg
+				perform.ViewCount = sectask.ViewNum
+				perform.CollectCount = sectask.CollectNum
+				perform.CommentCount = sectask.CommitAvg
+
+			}
+			talentDataParams = append(talentDataParams, &perform)
+		}
+	} else if param.TaskType == 3 {
+		prjtasks, total3, err3 := dao.LocalLifeTaskInfoDao{}.GetLocalLifeInfoByTalentId(param.TalentId, param.Others, param.SortField, param.SortOrder, param.Page, param.PageSize, param.RelType, param.EnterpriseId, param.Platform)
+		total = total3
+		if err3 != nil {
+			return result, err3
+		}
+		for _, sectask := range prjtasks {
+			var perform vo.TalentPerformance
+			secid := sectask.LocalID
+			sec, err2 := dao.ProjectDAO{}.GetProjectById(secid)
+			if err2 != nil {
+				return result, err2
+			}
+			var product entity.Product
+			var productMainPhoto entity.ProductPhoto
+			err11 := json.Unmarshal([]byte(sec.ProductSnap), &product)
+			err12 := json.Unmarshal([]byte(sec.ProductPhotoSnap), &productMainPhoto)
+			if err11 != nil || err12 != nil {
+				perform.MainImage = productMainPhoto.PhotoUrl
+				perform.ProductName = product.ProductName
+				perform.Price = product.ProductPrice
+				perform.VoteCount = int(sectask.VoteAvg)
+				perform.ViewCount = 0
+				perform.CollectCount = sectask.CollectNum
+				perform.CommentCount = int(sectask.CommitAvg)
+
+			}
+			talentDataParams = append(talentDataParams, &perform)
+		}
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     talentDataParams,
+	}
+	return result, nil
+}
+
 // 服务商管理-服务商数据卡列表
 func (t CooperationService) GetSupplierPerform(param *vo.SupplierDataParam) (vo.ResultVO, error) {
 	if param.Page <= 0 {

+ 54 - 0
app/vo/re_talent_coop_data.go

@@ -0,0 +1,54 @@
+package vo
+
+type ReTalentData struct {
+	TalentDataPreview *TalentDataPreview `json:"TalentDataPreview"`
+	TalentCoreData    *TalentCoreData    `json:"TalentcoreData"`
+}
+
+type ReTalentCoopData struct {
+	TalentDataPreview *TalentDataPreview `json:"TalentDataPreview"`
+	TalentCoopData    *TalentCoopData    `json:"TalentcoopData"`
+}
+
+type TalentCoopData struct {
+	SignTaskNum     int64 `json:"SignTaskNum"`
+	SelectedTaskNum int64 `json:"SelectedTaskNum"`
+	PerformTaskNum  int64 `json:"PerformTaskNum"`
+	CompleteTaskNum int64 `json:"CompleteTaskNum"`
+}
+
+type TalentDataPreview struct {
+	TalentId        string `json:"TalentId"`
+	AvatarUrl       string `json:"avatar"`
+	Sex             string `json:"sex"`
+	TalentName      string `json:"TalentName"`
+	KuaishouAccount string `json:"kuaishouAccount"`
+	City            string `json:"city"`
+	WXAccount       string `json:"wxAccount"`
+	Phone           string `json:"phone"`
+	Skill           string `json:"skill"`
+	OpenId          string `json:"openId"`
+}
+
+type TalentCoreData struct {
+	FansNum       string  `json:"fansNum"`
+	AvgLikeNum    float64 `json:"avgLikeNum"`
+	AvgComment    float64 `json:"avgComment"`
+	AvgCollect    float64 `json:"avgCollect"`
+	ThirtySaleNum float64 `json:"thirtySaleNum"`
+	SixtySaleNum  float64 `json:"sixtySaleNum"`
+	NinetySaleNum float64 `json:"nineySaleNum"`
+}
+
+type TalentPerformance struct {
+	MainImage   string  `json:"mainImage"`
+	ProductName string  `json:"productName"`
+	Price       float64 `json:"price"`
+
+	ViewCount    int    `json:"viewCount"`
+	VoteCount    int    `json:"voteCount"`
+	CollectCount int    `json:"collectCount"`
+	CommentCount int    `json:"commentCount"`
+	Category     string `json:"category"`
+	SalesNum     int64  `json:"salesNum"`
+}

+ 16 - 0
app/vo/talent_search_param.go

@@ -0,0 +1,16 @@
+package vo
+
+type TalentDataParam struct {
+	EnterpriseId   string   `json:"enterprise_id"`
+	SubAccountId   int64    `json:"sub_account_id"`
+	TalentId       string   `json:"Talent_id"`
+	Platform       int      `json:"platform"`
+	Page           int      `json:"page"`
+	PageSize       int      `json:"page_size"`
+	Others         string   `json:"others"` // 任务标题
+	PlatFormUserId string   `json:"platform_userid"`
+	SortField      []string `json:"sort_field,omitempty"`
+	SortOrder      []string `json:"sort_order,omitempty"`
+	TaskType       int      `json:"task_type"` // 1带货,2种草,3本地生活
+	RelType        int      `json:"rel_type"`  // 1不限,2只与本账号相关
+}

+ 11 - 1
db/locallife_task.go

@@ -417,7 +417,12 @@ func PassLocalTaskCoop(ctx context.Context, req http_model.PasslocalTaskCoopRequ
 				err = tx.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", taskInfo.SLocalLifeId).Updates(sprojectinfo).Error
 				if err != nil {
 					return err
-				} //
+				}
+				//
+				err = CoopEnterpriseTalent(db, taskInfo.TaskId, taskInfo.TalentId, taskInfo.OpenId, req.EnterpriseId, &taskInfo.SupplierId, taskInfo.PlatformId, 3, 2, nil)
+				if err != nil {
+					return err
+				}
 
 			}
 
@@ -469,6 +474,11 @@ func PassLocalTaskCoop(ctx context.Context, req http_model.PasslocalTaskCoopRequ
 				if err != nil {
 					return err
 				}
+
+				err = CoopEnterpriseTalent(db, taskInfo.TaskId, taskInfo.TalentId, taskInfo.OpenId, req.EnterpriseId, nil, taskInfo.PlatformId, 3, 1, nil)
+				if err != nil {
+					return err
+				}
 			}
 
 		}

+ 88 - 0
db/project_task.go

@@ -353,6 +353,83 @@ func stype(db *gorm.DB, supplierID, supplierStatus int, projecttype int64) (int,
 		return 0, "私域"
 	}
 }
+
+// IsCoop
+func IsCoop(db *gorm.DB, enterpriseid string, talentid string, platform int, cooptype int) bool {
+	var count int64
+	err := db.Model(&gorm_model.EnterpriseTalentCooperate{}).
+		Where("enterprise_id = ? AND talent_id = ? AND cooperate_type = ? AND platform = ?",
+			enterpriseid, talentid, cooptype, platform).
+		Count(&count).Error
+
+	return err == nil && count > 0
+}
+
+// CoopEnterpriseTalent
+func CoopEnterpriseTalent(db *gorm.DB, taskid string, talentid string, openid string, enterpriseid string, supplierid *int, platform int, cooptype int, talentorigin int, category *string) error {
+
+	// 检查是否已存在合作记录
+	if IsCoop(db, enterpriseid, talentid, platform, cooptype) {
+		// 更新现有记录
+		err := db.Model(&gorm_model.EnterpriseTalentCooperate{}).
+			Where("enterprise_id = ? AND talent_id = ? AND cooperate_type = ? AND platform = ?",
+				enterpriseid, talentid, cooptype, platform).
+			Update("cooperate_num", gorm.Expr("cooperate_num + ?", 1)).Error
+		if err != nil {
+			return fmt.Errorf("failed to update cooperation: %w", err)
+		}
+		return nil
+	}
+
+	// 创建新记录
+	ETCoopInfo := gorm_model.EnterpriseTalentCooperate{
+		EnterpriseId:  enterpriseid,
+		TalentId:      talentid,
+		CooperateType: cooptype,
+		Platform:      platform,
+		CreateAt:      time.Now(),
+		TalentOrigin:  talentorigin,
+		CooperateNum:  1,
+	}
+
+	// 获取达人信息
+	var talentinfo gorm_model.PlatformKuaishouUserInfo
+	if err := db.Where(gorm_model.PlatformKuaishouUserInfo{OpenId: openid}).First(&talentinfo).Error; err != nil {
+		return err
+	}
+
+	ETCoopInfo.TalentName = talentinfo.NickName
+	ETCoopInfo.PlatformUserID = talentinfo.Id
+
+	// 根据合作类型设置不同的任务ID字段
+	switch cooptype {
+	case 1:
+		ETCoopInfo.SecTaskID = taskid
+		if category == nil {
+			return errors.New("category is required when cooptype is 1")
+		}
+		ETCoopInfo.Category = *category
+	case 2:
+		ETCoopInfo.ProjectTaskID = taskid
+	case 3:
+		ETCoopInfo.LocalTaskID = taskid
+	}
+
+	// 只有在talentorigin为2时才设置supplierid
+	if talentorigin == 2 {
+		if supplierid == nil {
+			return errors.New("supplierid is required when talentorigin is 2")
+		}
+		ETCoopInfo.SupplierId = *supplierid
+	}
+
+	if err := db.Create(&ETCoopInfo).Error; err != nil {
+		return fmt.Errorf("failed to create cooperation: %w", err)
+	}
+
+	return nil
+}
+
 func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, operatorid string, operatetype int, Isspecial int, Enterpriseid string, req http_model.PassproTaskCoopRequest) (bool, error) {
 	db := GetReadDB(ctx)
 	var count int64
@@ -486,6 +563,11 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
 					return err
 				}
 
+				err = CoopEnterpriseTalent(db, taskInfo.TaskID, taskInfo.TalentID, taskInfo.OpenId, Enterpriseid, &taskInfo.SupplierId, taskInfo.PlatformId, 2, 2, nil)
+				if err != nil {
+					return err
+				}
+
 			}
 
 			if project.ProjectForm != 1 { //非签收截止时间
@@ -537,6 +619,12 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
 					return nil
 				}
 
+				//合作
+				err = CoopEnterpriseTalent(db, taskInfo.TaskID, taskInfo.TalentID, taskInfo.OpenId, Enterpriseid, nil, taskInfo.PlatformId, 2, 1, nil)
+				if err != nil {
+					return err
+				}
+
 			}
 
 		}

+ 15 - 0
db/sectask.go

@@ -214,6 +214,12 @@ func PassSecTaskCoop(ctx context.Context, selectionId string, taskIds []string,
 		return false, errors.New("任务id有误")
 	}
 
+	var tasks []gorm_model.YounggeeSecTaskInfo
+	err = db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ?", taskIds).Find(&tasks).Error
+	if err != nil {
+		return false, err
+	}
+
 	// 2. 查询任务对应达人id(用于生成达人消息)
 	var talentIds []string
 	err = db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ?", taskIds).Select("talent_id").Find(&talentIds).Error
@@ -292,6 +298,15 @@ func PassSecTaskCoop(ctx context.Context, selectionId string, taskIds []string,
 				return err
 			}
 		}
+
+		//5.合作
+		for _, task := range tasks {
+			err = CoopEnterpriseTalent(tx, task.TaskID, task.TalentID, task.OpenID, enterpriseId, nil, 4, 1, 1, &selection.ProductCategory)
+			if err != nil {
+				return fmt.Errorf("failed to create cooperation for task %s: %w", task.TaskID, err)
+			}
+		}
+
 		// 返回 nil 提交事务
 		return nil
 	})

+ 59 - 44
db/talent.go

@@ -82,7 +82,10 @@ func GetGoodstalentList(ctx context.Context, request http_model.GetGoodsTalentRe
 		// Default sorting if no valid sort parameters
 		query = query.Order("create_at asc")
 	}
-
+	var total int64
+	if err := query.Count(&total).Error; err != nil {
+		return nil, err
+	}
 	// 分页查询
 	offset := (request.PageNum - 1) * request.PageSize
 	query = query.Limit(request.PageSize).Offset(offset)
@@ -94,7 +97,7 @@ func GetGoodstalentList(ctx context.Context, request http_model.GetGoodsTalentRe
 
 	// 生成返回的数据
 	result := &http_model.GetGoodsTalentListData{
-		Total:      conv.MustString(len(etcoopinfo), ""),
+		Total:      conv.MustString(total, ""),
 		TalentList: make([]*http_model.GoodsTalentInfo, 0),
 	}
 
@@ -106,16 +109,17 @@ func GetGoodstalentList(ctx context.Context, request http_model.GetGoodsTalentRe
 		}
 		fans, _ := conv.Int(salesInfo.Fan)
 		result.TalentList = append(result.TalentList, &http_model.GoodsTalentInfo{
-			TalentId:    item.TalentId,
-			Nickname:    item.TalentName,
-			City:        salesInfo.City,
-			HeadUrl:     salesInfo.HeadUri,
-			FansNum:     fans,
-			ThirtySales: salesInfo.SaleNum30Day,
-			AccSales:    salesInfo.SaleNumTotal,
-			ActualSales: GetActualSales(db, salesInfo.OpenId), //open_id sec_task sale_actual
-			AccCoopTime: item.CooperateNum,
-			FirCoopFrom: "公海",
+			TalentId:       item.TalentId,
+			Nickname:       item.TalentName,
+			City:           salesInfo.City,
+			HeadUrl:        salesInfo.HeadUri,
+			FansNum:        fans,
+			ThirtySales:    salesInfo.SaleNum30Day,
+			AccSales:       salesInfo.SaleNumTotal,
+			ActualSales:    GetActualSales(db, salesInfo.OpenId), //open_id sec_task sale_actual
+			AccCoopTime:    item.CooperateNum,
+			FirCoopFrom:    "公海",
+			PlatformUserid: item.PlatformUserID,
 		})
 	}
 
@@ -194,7 +198,10 @@ func GetProjecttalentList(ctx context.Context, request http_model.GetProjectTale
 		// Default sorting if no valid sort parameters
 		query = query.Order("create_at asc")
 	}
-
+	var total int64
+	if err := query.Count(&total).Error; err != nil {
+		return nil, err
+	}
 	// 分页查询
 	offset := (request.PageNum - 1) * request.PageSize
 	query = query.Limit(request.PageSize).Offset(offset)
@@ -206,7 +213,7 @@ func GetProjecttalentList(ctx context.Context, request http_model.GetProjectTale
 
 	// 生成返回的数据
 	result := &http_model.GetProjectTalentListData{
-		Total:      conv.MustString(len(etcoopinfo), ""),
+		Total:      conv.MustString(total, ""),
 		TalentList: make([]*http_model.ProjectTalentInfo, 0),
 	}
 
@@ -228,19 +235,20 @@ func GetProjecttalentList(ctx context.Context, request http_model.GetProjectTale
 		}
 		s_type, s_name := stype(db, taskinfo.SupplierId, taskinfo.SupplierStatus, projectinfo.ProjectType)
 		result.TalentList = append(result.TalentList, &http_model.ProjectTalentInfo{
-			TalentId:     item.TalentId,
-			Nickname:     item.TalentName,
-			City:         salesInfo.City,
-			HeadUrl:      salesInfo.HeadUri,
-			FansNum:      fans,
-			AccInteract:  0,
-			AccPlay:      0,
-			AvgCollected: 0,
-			AvgComments:  0,
-			AvgLikes:     0,
-			AccCoopTime:  item.CooperateNum,
-			FirCoopFrom:  s_name,
-			Stype:        s_type,
+			PlatformUserid: item.PlatformUserID,
+			TalentId:       item.TalentId,
+			Nickname:       item.TalentName,
+			City:           salesInfo.City,
+			HeadUrl:        salesInfo.HeadUri,
+			FansNum:        fans,
+			AccInteract:    0,
+			AccPlay:        0,
+			AvgCollected:   0,
+			AvgComments:    0,
+			AvgLikes:       0,
+			AccCoopTime:    item.CooperateNum,
+			FirCoopFrom:    s_name,
+			Stype:          s_type,
 		})
 	}
 
@@ -251,11 +259,11 @@ func GetLocallifetalentList(ctx context.Context, request http_model.GetLocallife
 	db := GetReadDB(ctx)
 	// 存储达人信息
 	var etcoopinfo []gorm_model.EnterpriseTalentCooperate
-	query := db.Model(&gorm_model.EnterpriseTalentCooperate{}).Where("enterprise_id = ? AND cooperate_type = ?", request.EnterpriseId, 2)
+	query := db.Model(&gorm_model.EnterpriseTalentCooperate{}).Where("enterprise_id = ? AND cooperate_type = ?", request.EnterpriseId, 3)
 
 	// 根据平台筛选
 	if request.Platform != nil {
-		query.Where("platform = ?", request.Platform)
+		query.Where("platform = ?", &request.Platform)
 	}
 
 	// 根据达人名称筛选
@@ -266,6 +274,9 @@ func GetLocallifetalentList(ctx context.Context, request http_model.GetLocallife
 	// 获取相关的销量信息,可以通过join连接platform_kuaishou_user_info表
 	query = query.Joins("JOIN platform_kuaishou_user_info pkui ON pkui.id = enterprise_talent_cooperate.platform_user_id")
 
+	if request.Area != "" {
+		query = query.Where("city = ?", request.Area)
+	}
 	// 根据排序字段和排序顺序进行排序
 	if len(request.SortField) > 0 && len(request.SortOrder) > 0 && len(request.SortField) == len(request.SortOrder) {
 		for i := 0; i < len(request.SortField); i++ {
@@ -306,7 +317,10 @@ func GetLocallifetalentList(ctx context.Context, request http_model.GetLocallife
 		// Default sorting if no valid sort parameters
 		query = query.Order("create_at asc")
 	}
-
+	var total int64
+	if err := query.Count(&total).Error; err != nil {
+		return nil, err
+	}
 	// 分页查询
 	offset := (request.PageNum - 1) * request.PageSize
 	query = query.Limit(request.PageSize).Offset(offset)
@@ -318,7 +332,7 @@ func GetLocallifetalentList(ctx context.Context, request http_model.GetLocallife
 
 	// 生成返回的数据
 	result := &http_model.GetLocallifeTalentListData{
-		Total:      conv.MustString(len(etcoopinfo), ""),
+		Total:      conv.MustString(total, ""),
 		TalentList: make([]*http_model.LocallifeTalentInfo, 0),
 	}
 
@@ -340,19 +354,20 @@ func GetLocallifetalentList(ctx context.Context, request http_model.GetLocallife
 		}
 		s_type, s_name := stype(db, taskinfo.SupplierId, taskinfo.SupplierStatus, projectinfo.LocalType)
 		result.TalentList = append(result.TalentList, &http_model.LocallifeTalentInfo{
-			TalentId:     item.TalentId,
-			Nickname:     item.TalentName,
-			City:         salesInfo.City,
-			HeadUrl:      salesInfo.HeadUri,
-			FansNum:      fans,
-			AccInteract:  0,
-			AccPlay:      0,
-			AvgCollected: 0,
-			AvgComments:  0,
-			AvgLikes:     0,
-			AccCoopTime:  item.CooperateNum,
-			FirCoopFrom:  s_name,
-			SType:        s_type,
+			PlatformUserid: item.PlatformUserID,
+			TalentId:       item.TalentId,
+			Nickname:       item.TalentName,
+			City:           salesInfo.City,
+			HeadUrl:        salesInfo.HeadUri,
+			FansNum:        fans,
+			AccInteract:    0,
+			AccPlay:        0,
+			AvgCollected:   0,
+			AvgComments:    0,
+			AvgLikes:       0,
+			AccCoopTime:    item.CooperateNum,
+			FirCoopFrom:    s_name,
+			SType:          s_type,
 		})
 	}
 

+ 1 - 0
model/gorm_model/enterprise_talent_cooperate.go

@@ -17,6 +17,7 @@ type EnterpriseTalentCooperate struct {
 	PlatformUserID int       `gorm:"column:platform_user_id"` // 第三方平台ID
 	CreateAt       time.Time `gorm:"column:create_at"`        // 创建时间
 	TalentName     string    `gorm:"column:talent_name"`
+	Category       string    `gorm:"column:product_category"`
 }
 
 func (m *EnterpriseTalentCooperate) TableName() string {

+ 1 - 0
model/gorm_model/project_task.go

@@ -50,6 +50,7 @@ type YoungeeTaskInfo struct {
 	VoteAvg                int       `gorm:"column:vote_avg"`                             // 平均点赞数
 	CommitAvg              int       `gorm:"column:commit_avg"`                           // 平均评论数
 	CollectNum             int       `gorm:"column:collect_num"`
+	PlatformId             int       `gorm:"column:platform_id;type:int(11);comment:平台" json:"platform_id"`
 	BOperator              string    `gorm:"column:b_operator"`      // 商家确定达人操作人ID
 	BOperatorType          int       `gorm:"column:b_operator_type"` // 商家操作人类型,1商家用户,2商家子账号,3管理后台
 	SOperator              int       `gorm:"column:s_operator"`      // 服务商提报达人操作人ID

+ 1 - 0
model/gorm_model/selection_info.go

@@ -10,6 +10,7 @@ type YounggeeSelectionInfo struct {
 	EnterpriseID      string     `gorm:"column:enterprise_id"`            // 所属企业id
 	SubAccountId      int        `gorm:"column:sub_account_id"`           // 子账号id
 	ProductID         int        `gorm:"column:product_id"`               // 关联商品id
+	ProductCategory   string     `gorm:"column:product_category"`         //商品类目
 	ContentType       int        `gorm:"column:content_type"`             // 内容形式,1代表图文,2代表视频,3代表直播
 	SelectionStatus   int        `gorm:"column:selection_status"`         // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
 	TaskMode          int        `gorm:"column:task_mode"`                // 任务形式,1、2分别表示悬赏任务、纯佣带货

+ 11 - 10
model/http_model/getgoodstalentrequest.go

@@ -18,16 +18,17 @@ type GetGoodsTalentListData struct {
 }
 
 type GoodsTalentInfo struct {
-	TalentId    string `json:"talent_id"`
-	Nickname    string `json:"nickname"`
-	City        string `json:"city"`
-	HeadUrl     string `json:"head_url"`
-	FansNum     int    `json:"fans_num"`
-	ThirtySales int    `json:"thirty_sales"`
-	AccSales    int    `json:"acc_sales"`
-	ActualSales int    `json:"actual_sales"`
-	AccCoopTime int    `json:"acc_coop_time"`
-	FirCoopFrom string `json:"fir_coop_from"`
+	TalentId       string `json:"talent_id"`
+	Nickname       string `json:"nickname"`
+	City           string `json:"city"`
+	HeadUrl        string `json:"head_url"`
+	FansNum        int    `json:"fans_num"`
+	ThirtySales    int    `json:"thirty_sales"`
+	AccSales       int    `json:"acc_sales"`
+	ActualSales    int    `json:"actual_sales"`
+	AccCoopTime    int    `json:"acc_coop_time"`
+	FirCoopFrom    string `json:"fir_coop_from"`
+	PlatformUserid int    `json:"platform_userid"`
 }
 
 func NewGetGoodsTalentRequest() *GetGoodsTalentRequest {

+ 16 - 14
model/http_model/getlocallifetalentrequest.go

@@ -5,9 +5,10 @@ type GetLocallifeTalentRequest struct {
 	PageNum      int      `json:"page_num"`
 	SortField    []string `json:"sort_field,omitempty"`
 	SortOrder    []string `json:"sort_order,omitempty"` //粉丝数,实际带货销量,近30天销量,累计合作次数
-	Platform     *string  `json:"platform,omitempty"`
+	Platform     *int     `json:"platform,omitempty"`
 	TalentName   string   `json:"talent_name"`
 	EnterpriseId string   `json:"enterprise_id"`
+	Area         string   `json:"area"`
 }
 
 type GetLocallifeTalentListData struct {
@@ -16,19 +17,20 @@ type GetLocallifeTalentListData struct {
 }
 
 type LocallifeTalentInfo struct {
-	TalentId     string `json:"talent_id"`
-	Nickname     string `json:"nickname"`
-	City         string `json:"city"`
-	HeadUrl      string `json:"head_url"`
-	FansNum      int    `json:"fans_num"`
-	AvgLikes     int    `json:"avg_likes"`
-	AvgCollected int    `json:"avg_collected"`
-	AvgComments  int    `json:"avg_comments"`
-	AccPlay      int    `json:"acc_play"`
-	AccInteract  int    `json:"acc_interact"`
-	AccCoopTime  int    `json:"acc_coop_time"`
-	FirCoopFrom  string `json:"fir_coop_from"`
-	SType        int    `json:"stype"`
+	TalentId       string `json:"talent_id"`
+	Nickname       string `json:"nickname"`
+	City           string `json:"city"`
+	HeadUrl        string `json:"head_url"`
+	FansNum        int    `json:"fans_num"`
+	AvgLikes       int    `json:"avg_likes"`
+	AvgCollected   int    `json:"avg_collected"`
+	AvgComments    int    `json:"avg_comments"`
+	AccPlay        int    `json:"acc_play"`
+	AccInteract    int    `json:"acc_interact"`
+	AccCoopTime    int    `json:"acc_coop_time"`
+	FirCoopFrom    string `json:"fir_coop_from"`
+	SType          int    `json:"stype"`
+	PlatformUserid int    `json:"platform_userid"`
 }
 
 func NewGetLocallifeTalentRequest() *GetLocallifeTalentRequest {

+ 9 - 8
model/http_model/getprojecttalentrequest.go

@@ -24,14 +24,15 @@ type ProjectTalentInfo struct {
 	//ThirtySales string `json:"thirty_sales"`
 	//AccSales    string `json:"acc_sales"`
 	//ActualSales string `json:"actual_sales"`
-	AvgLikes     int    `json:"avg_likes"`
-	AvgCollected int    `json:"avg_collected"`
-	AvgComments  int    `json:"avg_comments"`
-	AccPlay      int    `json:"acc_play"`
-	AccInteract  int    `json:"acc_interact"`
-	AccCoopTime  int    `json:"acc_coop_time"`
-	FirCoopFrom  string `json:"fir_coop_from"`
-	Stype        int    `json:"stype"`
+	AvgLikes       int    `json:"avg_likes"`
+	AvgCollected   int    `json:"avg_collected"`
+	AvgComments    int    `json:"avg_comments"`
+	AccPlay        int    `json:"acc_play"`
+	AccInteract    int    `json:"acc_interact"`
+	AccCoopTime    int    `json:"acc_coop_time"`
+	FirCoopFrom    string `json:"fir_coop_from"`
+	Stype          int    `json:"stype"`
+	PlatformUserid int    `json:"platform_userid"`
 }
 
 func NewGetProjectTalentRequest() *GetProjectTalentRequest {

+ 5 - 1
route/init.go

@@ -398,6 +398,7 @@ func InitRoute(r *gin.Engine) {
 		cooperation.POST("/count", controller.CooperationController{}.GetSupplierCount)               // 服务商管理-角标
 		cooperation.POST("/data", controller.CooperationController{}.GetSupplierData)                 // 服务商管理-服务商数据卡
 		cooperation.POST("/perform", controller.CooperationController{}.GetSupplierPerform)           // 服务商管理-服务商数据卡列表
+
 	}
 	// 推广合作-商品管理相关接口
 	product := r.Group("/youngee/b/cooperation/product")
@@ -428,7 +429,10 @@ func InitRoute(r *gin.Engine) {
 		talent.POST("/projecttalent", handler.WrapGetProjectTalentHandler)     //种草达人
 		talent.POST("/locallifetalent", handler.WrapGetLocallifeTalentHandler) //本地生活达人
 
-		talent.POST("/historyDataList", handler.WrapHistoryDataListHandler) // 达人历史作品列表
+		talent.POST("/talentdata", controller.CooperationController{}.GetTalentData)   //达人管理-达人数据卡
+		talent.POST("/coopdata", controller.CooperationController{}.GetCoopTalentData) //	合作数据
+		talent.POST("/perform", controller.CooperationController{}.GetTalentPerform)   //达人数据卡列表
+		talent.POST("/historyDataList", handler.WrapHistoryDataListHandler)            // 达人历史作品列表
 	}
 
 	// moreAPI取数