wangkaiyue 11 months ago
parent
commit
449e4dbccb
1 changed files with 16 additions and 9 deletions
  1. 16 9
      service/power.go

+ 16 - 9
service/power.go

@@ -148,8 +148,11 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
 			free.EntnicheApppushunread = i_entniche_apppushunread
 			free.MemberApppushunread = i_member_apppushunread
 			//个人权益
+
+			var o_jy map[string]interface{}
+
 			if positionType == 0 {
-				o_jy, _ := (*data)["o_jy"].(map[string]interface{})
+				o_jy, _ = (*data)["o_jy"].(map[string]interface{})
 				a_key, _ := o_jy["a_key"].([]interface{})
 				free.FreeHasKey = len(a_key) > 0
 				free.OjyLength = int64(len(o_jy))
@@ -157,14 +160,6 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
 					//IsNewFreeTimeCell dev3.6.4版本之前发了个紧急版本处理老用户订阅问题,i_newfree字段必须用户选择地区才能生成,不能作为判断是否是新用户得唯一标识,在此版本添加了常量:IsNewFreeTimeCell作为判断标准;--ws
 					free.IsUpgrade = true //新免费用户
 				}
-				//省份订阅包
-				free.PpStatus = common.Int64All(o_jy["i_ppstatus"])
-				free.PpStartTime = common.Int64All(o_jy["l_areaStart_p"])
-				free.PpEndTime = common.Int64All(o_jy["l_areaEnd_p"])
-
-				if ppBuyset, _ := o_jy["o_buyset_p"].(map[string]interface{}); ppBuyset != nil && len(ppBuyset) > 0 {
-					free.PpAreaCount = common.Int64All(ppBuyset["areacount"])
-				}
 
 				//超级订阅
 				vipStatus := common.Int64All((*data)["i_vip_status"])
@@ -327,6 +322,18 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
 					}
 				}
 			}
+
+			if o_jy != nil && len(o_jy) > 0 {
+				//省份订阅包
+				free.PpStatus = common.Int64All(o_jy["i_ppstatus"])
+				free.PpStartTime = common.Int64All(o_jy["l_areaStart_p"])
+				free.PpEndTime = common.Int64All(o_jy["l_areaEnd_p"])
+
+				if ppBuyset, _ := o_jy["o_buyset_p"].(map[string]interface{}); ppBuyset != nil && len(ppBuyset) > 0 {
+					free.PpAreaCount = common.Int64All(ppBuyset["areacount"])
+				}
+			}
+
 			//大会员相关权益数量
 			memberServiceMap := map[int64]bool{}
 			serviceList := this.Conn.Mysql.Find("bigmember_service_user", bigmemberServiceUserQuery, "DISTINCT(s_serviceid),i_frequency", "", -1, -1)