|
@@ -55,6 +55,7 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
member := &entity.Member{}
|
|
member := &entity.Member{}
|
|
free := &entity.Free{}
|
|
free := &entity.Free{}
|
|
userPower := entity.Power{}
|
|
userPower := entity.Power{}
|
|
|
|
+ docs := &entity.Docs{}
|
|
if positionId == 0 {
|
|
if positionId == 0 {
|
|
free.IsFree = true
|
|
free.IsFree = true
|
|
return &entity.Power{
|
|
return &entity.Power{
|
|
@@ -63,6 +64,7 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
Free: free,
|
|
Free: free,
|
|
Ent: ent,
|
|
Ent: ent,
|
|
Entniche: entniche,
|
|
Entniche: entniche,
|
|
|
|
+ Docs: docs,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cacheBl := false
|
|
cacheBl := false
|
|
@@ -119,6 +121,10 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
mgoUserFields["i_apppushunread"] = 1
|
|
mgoUserFields["i_apppushunread"] = 1
|
|
mgoUserFields["i_member_starttime"] = 1
|
|
mgoUserFields["i_member_starttime"] = 1
|
|
mgoUserFields["i_member_endtime"] = 1
|
|
mgoUserFields["i_member_endtime"] = 1
|
|
|
|
+ mgoUserFields["i_doc_status"] = 1
|
|
|
|
+ mgoUserFields["l_doc_starttime"] = 1
|
|
|
|
+ mgoUserFields["l_doc_endtime"] = 1
|
|
|
|
+ mgoUserFields["i_doc_free_download"] = 1
|
|
} else {
|
|
} else {
|
|
bigmemberServiceUserQuery["s_userid"] = positionId
|
|
bigmemberServiceUserQuery["s_userid"] = positionId
|
|
}
|
|
}
|
|
@@ -217,6 +223,13 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
}
|
|
}
|
|
//获取大会员版本名称
|
|
//获取大会员版本名称
|
|
member.MemberName = level_map[memberStatus]
|
|
member.MemberName = level_map[memberStatus]
|
|
|
|
+ //文库
|
|
|
|
+ docs = &entity.Docs{
|
|
|
|
+ DocStatus: common.IntAll((*data)["i_doc_status"]),
|
|
|
|
+ StartDate: common.Int64All((*data)["l_doc_starttime"]),
|
|
|
|
+ EndDate: common.Int64All((*data)["l_doc_endtime"]),
|
|
|
|
+ FreeDownload: common.IntAll((*data)["i_doc_free_download"]),
|
|
|
|
+ }
|
|
} else if positionType == 1 {
|
|
} else if positionType == 1 {
|
|
entnicheUserId := this.GetEntnicheUserId(entId, phone)
|
|
entnicheUserId := this.GetEntnicheUserId(entId, phone)
|
|
//免费
|
|
//免费
|
|
@@ -298,6 +311,15 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
member.Used = true
|
|
member.Used = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //文库
|
|
|
|
+ if common.Int64All((*eudata)["i_doc_status"]) > 0 {
|
|
|
|
+ docs = &entity.Docs{
|
|
|
|
+ DocStatus: common.IntAll((*data)["i_doc_status"]),
|
|
|
|
+ StartDate: common.Int64All((*data)["l_doc_starttime"]),
|
|
|
|
+ EndDate: common.Int64All((*data)["l_doc_endtime"]),
|
|
|
|
+ FreeDownload: common.IntAll((*data)["i_doc_free_download"]),
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//大会员相关权益数量
|
|
//大会员相关权益数量
|
|
@@ -410,6 +432,14 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //文库 非文库会员,确认免费下载机会状态 免费下载机会没有被消耗
|
|
|
|
+ //FreeDownload 0:未留资 有一次留资免费机会;2:已留资 下载机会未使用
|
|
|
|
+ if userPower.Docs.DocStatus <= 0 && userPower.Docs.FreeDownload == 0 {
|
|
|
|
+ sc := this.MgoJy.Count("saleLeads", map[string]interface{}{"userid": userid, "source": map[string]interface{}{"$in": []string{"pc_library_details_free", "app_library_details_free", "wx_library_details_free", "h5_library_details_free"}}})
|
|
|
|
+ if sc > 0 {
|
|
|
|
+ userPower.Docs.FreeDownload = 1 //已留资 未使用下载机会
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
userPower = entity.Power{
|
|
userPower = entity.Power{
|
|
Vip: vip,
|
|
Vip: vip,
|
|
@@ -417,6 +447,7 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
Free: free,
|
|
Free: free,
|
|
Ent: ent,
|
|
Ent: ent,
|
|
Entniche: entniche,
|
|
Entniche: entniche,
|
|
|
|
+ Docs: docs,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//存储缓存
|
|
//存储缓存
|