|
@@ -39,7 +39,7 @@ func (this *SubVipPortrait) SubVipEntDetail() {
|
|
|
if entId == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- cepm, err := entity.CreateSubVipPortraitManager(userId, "entDetail", entId, true)
|
|
|
+ cepm, _, err := entity.CreateSubVipPortraitManager(userId, "entDetail", entId, true)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -64,7 +64,7 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
|
|
|
if entId == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- cepm, err := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
|
|
|
+ cepm, _, err := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -108,7 +108,7 @@ func (this *SubVipPortrait) SubVipNewMsgSelects() {
|
|
|
if entId == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- _, err := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
|
|
|
+ _, _, err := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -129,7 +129,7 @@ func (this *SubVipPortrait) SubVipPortrait() {
|
|
|
if entId == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- cepm, err := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true)
|
|
|
+ cepm, _, err := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -159,14 +159,20 @@ func (this *SubVipPortrait) PortraitUsage() {
|
|
|
if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
|
|
|
return nil, fmt.Errorf("非法请求")
|
|
|
}
|
|
|
- entId := util.DecodeId(this.GetString("entId"))
|
|
|
- total, usage, isUsed := bigMsg.SubVipPortraitUsage(db.Mysql, entId, this.GetString("p_type") != "1")
|
|
|
+ isWinner, queryEnt := this.GetString("p_type") != "1", ""
|
|
|
+ if isWinner {
|
|
|
+ queryEnt = util.DecodeId(this.GetString("entId"))
|
|
|
+ } else {
|
|
|
+ queryEnt = this.GetString("buyer")
|
|
|
+ }
|
|
|
+
|
|
|
+ total, usage, isUsed := bigMsg.SubVipPortraitUsage(db.Mysql, queryEnt, isWinner)
|
|
|
returnMap := map[string]interface{}{
|
|
|
"total": total,
|
|
|
"usage": usage,
|
|
|
"provin": bigMsg.Vip_BuySet.AreaCount,
|
|
|
}
|
|
|
- if entId != "" {
|
|
|
+ if queryEnt != "" {
|
|
|
returnMap["visited"] = isUsed
|
|
|
}
|
|
|
return returnMap, nil
|
|
@@ -238,7 +244,7 @@ func (this *SubVipPortrait) BuyerSelects() {
|
|
|
if buyer == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- _, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
|
|
|
+ _, _, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -261,7 +267,7 @@ func (this *SubVipPortrait) BuyerNewMsg() {
|
|
|
}
|
|
|
pageNum, _ := this.GetInteger("pageNum")
|
|
|
pageSize, _ := this.GetInteger("pageSize")
|
|
|
- cepm, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
|
|
|
+ cepm, hasPower, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait_newMsg", buyer, false)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -275,7 +281,7 @@ func (this *SubVipPortrait) BuyerNewMsg() {
|
|
|
Area: this.GetString("area"),
|
|
|
ScopeClass: this.GetString("scopeClass"),
|
|
|
TimeRange: this.GetString("timeRange"),
|
|
|
- HasPower: true,
|
|
|
+ HasPower: hasPower,
|
|
|
},
|
|
|
PageNum: pageNum,
|
|
|
PageSize: pageSize,
|
|
@@ -302,7 +308,7 @@ func (this *SubVipPortrait) BuyerContacts() {
|
|
|
if buyerName == "" {
|
|
|
return nil, fmt.Errorf("企业参数异常")
|
|
|
}
|
|
|
- cepm, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
|
|
|
+ cepm, _, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -328,7 +334,7 @@ func (this *SubVipPortrait) BuyerPortrait() {
|
|
|
if buyerName == "" {
|
|
|
return nil, fmt.Errorf("参数异常")
|
|
|
}
|
|
|
- cepm, err := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
|
|
|
+ cepm, power, err := entity.CreateSubVipPortraitManager(userId, "buyerPortraitNotCheckPower", buyerName, false)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -341,7 +347,7 @@ func (this *SubVipPortrait) BuyerPortrait() {
|
|
|
Area: this.GetString("area"),
|
|
|
ScopeClass: this.GetString("scopeClass"),
|
|
|
TimeRange: this.GetString("timeRange"),
|
|
|
- HasPower: true,
|
|
|
+ HasPower: power,
|
|
|
}, flag)
|
|
|
if err != nil {
|
|
|
return nil, err
|