|
@@ -27,11 +27,11 @@ type BigVipBaseMsg struct {
|
|
|
VipStatus int `json:"vip_status"` //超级订阅状态
|
|
|
Vip_BuySet BuySet `json:"vip_buyset"` //超级订阅套餐内容
|
|
|
|
|
|
- FreeEntPort int `json:"freeEntPort"` //免费用户可查看企业画像次数
|
|
|
- FreeBuyerPort int `json:"freeBuyerPort"` //免费用户可查看采购单位画像次数
|
|
|
- FreeFile int `json:"freeFile"` //免费用户可进行附件下载次数
|
|
|
- IsUpgrade bool `json:"isUpgrade"` //是否是免费用户订阅升级用户 默认true
|
|
|
- Registedate int64 `json:"registedate"` //用户注册时间
|
|
|
+ IsUpgrade bool `json:"isUpgrade"` //是否是免费用户订阅升级用户 默认true
|
|
|
+ Registedate int64 `json:"registedate"` //用户注册时间
|
|
|
+ // FreeEntPort int `json:"freeEntPort"` //免费用户可查看企业画像次数
|
|
|
+ // FreeBuyerPort int `json:"freeBuyerPort"` //免费用户可查看采购单位画像次数
|
|
|
+ // FreeFile int `json:"freeFile"` //免费用户可进行附件下载次数
|
|
|
}
|
|
|
|
|
|
//超级订阅购买内容
|
|
@@ -47,16 +47,22 @@ const (
|
|
|
BigmemberServiceTable = "bigmember_service"
|
|
|
BigmemberUserPowerTable = "bigmember_service_user"
|
|
|
|
|
|
- PowerCacheDb = "other"
|
|
|
- PowerCacheKey = "bigmember_power_3_%s"
|
|
|
- OneDay = 60 * 60 * 24
|
|
|
- PowerCacheEntPortKey = "ent_portrait_%s"
|
|
|
- PowerCacheBuyerPortKey = "buyer_portrait_%s"
|
|
|
- PowerCacheFileKey = "article_attach_%s"
|
|
|
+ PowerCacheDb = "other"
|
|
|
+ PowerCacheKey = "bigmember_power_3_%s"
|
|
|
+ OneDay = 60 * 60 * 24
|
|
|
+ PowerCacheEntPortKey = "free_ent_portrait_%s"
|
|
|
+ PowerCacheBuyerPortKey = "free_buyer_portrait_%s"
|
|
|
+ PowerCacheFileKey = "free_article_attach_%s"
|
|
|
UserUpdateAreaKey = "free_area_num_%s_%s"
|
|
|
BaseAreaNum = 1
|
|
|
)
|
|
|
|
|
|
+//免费用户体验会员功能权限
|
|
|
+//免费用户在企业画像/采购单位画像/附件下载留资 留资成功后用户才有功能使用次数
|
|
|
+func FreeExperience(userId string) (int, int, int) {
|
|
|
+ return redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheEntPortKey, userId)), redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheBuyerPortKey, userId)), redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheFileKey, userId))
|
|
|
+}
|
|
|
+
|
|
|
//初始化大会员权益
|
|
|
func InitBigVipService(mysql *mysql.Mysql) {
|
|
|
serviceList := mysql.Find(BigmemberServiceTable, nil, "id,s_url_front,s_url_back", "id", -1, -1)
|
|
@@ -137,10 +143,6 @@ func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *Big
|
|
|
}
|
|
|
//免费用户画像和附件下载权限
|
|
|
if userPower.Status <= 0 && userPower.VipStatus <= 0 {
|
|
|
- //免费用户在企业画像/采购单位画像/附件下载留资 留资成功后用户才有功能使用次数
|
|
|
- userPower.FreeEntPort = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheEntPortKey, userId))
|
|
|
- userPower.FreeBuyerPort = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheBuyerPortKey, userId))
|
|
|
- userPower.FreeFile = redis.GetInt(PowerCacheDb, fmt.Sprintf(PowerCacheFileKey, userId))
|
|
|
o_jy := qutil.ObjToMap((*data)["o_jy"])
|
|
|
//"i_newfree": 1, //新免费用户=>新订阅设置页面 20211122
|
|
|
if qutil.IntAll((*o_jy)["i_newfree"]) > 0 {
|