|
@@ -72,10 +72,13 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
|
|
if entId == "" {
|
|
if entId == "" {
|
|
return nil, fmt.Errorf("参数异常")
|
|
return nil, fmt.Errorf("参数异常")
|
|
}
|
|
}
|
|
- cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, this.Session())
|
|
|
|
|
|
+ cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, this.Session())
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
+ if free {
|
|
|
|
+ return nil, errors.New("无查看权益")
|
|
|
|
+ }
|
|
if power <= 1 {
|
|
if power <= 1 {
|
|
return nil, errors.New("非法请求")
|
|
return nil, errors.New("非法请求")
|
|
}
|
|
}
|
|
@@ -191,10 +194,13 @@ func (this *SubVipPortrait) SubVipPortrait() {
|
|
if entId == "" {
|
|
if entId == "" {
|
|
return nil, fmt.Errorf("参数异常")
|
|
return nil, fmt.Errorf("参数异常")
|
|
}
|
|
}
|
|
- cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true, this.Session())
|
|
|
|
|
|
+ cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true, this.Session())
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
+ if free {
|
|
|
|
+ return nil, fmt.Errorf("无查看权益")
|
|
|
|
+ }
|
|
rData, err := cepm.WinnerPortraitData(&entity.PortraitScreen{
|
|
rData, err := cepm.WinnerPortraitData(&entity.PortraitScreen{
|
|
Ent: entId,
|
|
Ent: entId,
|
|
Match: this.GetString("match"),
|
|
Match: this.GetString("match"),
|
|
@@ -339,10 +345,13 @@ func (this *SubVipPortrait) BuyerNewMsg() {
|
|
}
|
|
}
|
|
pageNum, _ := this.GetInteger("pageNum")
|
|
pageNum, _ := this.GetInteger("pageNum")
|
|
pageSize, _ := this.GetInteger("pageSize")
|
|
pageSize, _ := this.GetInteger("pageSize")
|
|
- cepm, power, err, _ := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyer, false, this.Session())
|
|
|
|
|
|
+ cepm, power, err, free := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyer, false, this.Session())
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
+ if free {
|
|
|
|
+ return nil, fmt.Errorf("无查看权益")
|
|
|
|
+ }
|
|
//免费用户仅可查看三条记录
|
|
//免费用户仅可查看三条记录
|
|
rData, total, err := cepm.GetBuyerNewMsg(&entity.PortraitProjectScreen{
|
|
rData, total, err := cepm.GetBuyerNewMsg(&entity.PortraitProjectScreen{
|
|
Screen: &entity.PortraitScreen{
|
|
Screen: &entity.PortraitScreen{
|
|
@@ -461,8 +470,14 @@ func (this *SubVipPortrait) BuyerPortrait() {
|
|
if buyerName == "" {
|
|
if buyerName == "" {
|
|
return nil, fmt.Errorf("参数异常")
|
|
return nil, fmt.Errorf("参数异常")
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
|
|
|
|
+ cepm.Session = this.Session()
|
|
|
|
+ if err != nil {
|
|
|
|
+ return nil, err
|
|
|
|
+ }
|
|
redisKey := fmt.Sprintf("buyerPortraitKey_%s", buyerName)
|
|
redisKey := fmt.Sprintf("buyerPortraitKey_%s", buyerName)
|
|
- if userId == "" {
|
|
|
|
|
|
+ if userId == "" || isFree {
|
|
if bytes, err := redis.GetBytes("other", redisKey); err == nil && bytes != nil {
|
|
if bytes, err := redis.GetBytes("other", redisKey); err == nil && bytes != nil {
|
|
rData := make(map[string]interface{})
|
|
rData := make(map[string]interface{})
|
|
if err = json.Unmarshal(*bytes, &rData); err != nil {
|
|
if err = json.Unmarshal(*bytes, &rData); err != nil {
|
|
@@ -470,7 +485,7 @@ func (this *SubVipPortrait) BuyerPortrait() {
|
|
return rData, nil
|
|
return rData, nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- q := `{"size": 1,"_source": ["buyerclass","province","city"],"query": {"match_phrase": {"name": "%s"}}}`
|
|
|
|
|
|
+ q := `{"size": 1,"_source": ["buyerclass","province","city","name"],"query": {"match_phrase": {"name": "%s"}}}`
|
|
data := elastic.Get("buyer", "buyer", fmt.Sprintf(q, buyerName))
|
|
data := elastic.Get("buyer", "buyer", fmt.Sprintf(q, buyerName))
|
|
if data != nil && len(*data) > 0 {
|
|
if data != nil && len(*data) > 0 {
|
|
rData := (*data)[0]
|
|
rData := (*data)[0]
|
|
@@ -481,11 +496,6 @@ func (this *SubVipPortrait) BuyerPortrait() {
|
|
}
|
|
}
|
|
return nil, nil
|
|
return nil, nil
|
|
}
|
|
}
|
|
- cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
|
|
|
|
- cepm.Session = this.Session()
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
flag := this.GetString("flag") //分段请求标识
|
|
flag := this.GetString("flag") //分段请求标识
|
|
userLevel := 3
|
|
userLevel := 3
|
|
if userId != "" {
|
|
if userId != "" {
|