|
@@ -10,6 +10,7 @@ import (
|
|
|
"hongze/hongze_yb/models/tables/yb_community_video"
|
|
|
"hongze/hongze_yb/models/tables/yb_road_video"
|
|
|
"hongze/hongze_yb/models/tables/yb_user_collection"
|
|
|
+ "hongze/hongze_yb/services/user"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
"strings"
|
|
|
"sync"
|
|
@@ -24,7 +25,8 @@ const (
|
|
|
)
|
|
|
|
|
|
// AddCollection 加入收藏
|
|
|
-func AddCollection(userId, collectionType, primaryId, extendId, sourceAgent int, companyId int64) (collectionId int, err error) {
|
|
|
+func AddCollection(userInfo user.UserInfo, collectionType, primaryId, extendId, sourceAgent int) (collectionId int, err error) {
|
|
|
+ userId := int(userInfo.UserID)
|
|
|
if userId <= 0 || collectionType <= 0 || primaryId <= 0 {
|
|
|
return
|
|
|
}
|
|
@@ -111,17 +113,19 @@ func AddCollection(userId, collectionType, primaryId, extendId, sourceAgent int
|
|
|
err = errors.New(fmt.Sprintf("收藏类型有误, 当前收藏类型%d", collectionType))
|
|
|
return
|
|
|
}
|
|
|
+ companyName := "潜在客户"
|
|
|
companyStatus := "潜在"
|
|
|
sellerId := 0
|
|
|
- if companyId > 0 {
|
|
|
+ if userInfo.CompanyID > 0 {
|
|
|
//查询ficc产品信息和ficc销售信息
|
|
|
- companyInfo, e := company_product.GetByCompany2ProductId(companyId, 1)
|
|
|
+ companyInfo, e := company_product.GetByCompany2ProductId(userInfo.CompanyID, 1)
|
|
|
if e != nil && e != utils.ErrNoRow {
|
|
|
err = errors.New("获取客户信息失败, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
if companyInfo != nil && companyInfo.CompanyID > 0 {
|
|
|
companyStatus = companyInfo.Status
|
|
|
+ companyName = companyInfo.CompanyName
|
|
|
sellerId = companyInfo.SellerID
|
|
|
}
|
|
|
}
|
|
@@ -130,7 +134,9 @@ func AddCollection(userId, collectionType, primaryId, extendId, sourceAgent int
|
|
|
item := &yb_user_collection.YbUserCollection{
|
|
|
CollectionType: collectionType,
|
|
|
UserID: userId,
|
|
|
- CompanyID: int(companyId),
|
|
|
+ RealName: userInfo.RealName,
|
|
|
+ CompanyID: int(userInfo.CompanyID),
|
|
|
+ CompanyName: companyName,
|
|
|
CompanyStatus: companyStatus,
|
|
|
SellerID: sellerId,
|
|
|
PrimaryID: primaryId,
|