|
@@ -107,7 +107,7 @@ func (userDoc *UserDoc) DocBuy() {
|
|
usePoint := true // 是否消耗剑鱼币 会员免费文档且当天100篇以内的或者使用免费下载机会的 不用扣积分
|
|
usePoint := true // 是否消耗剑鱼币 会员免费文档且当天100篇以内的或者使用免费下载机会的 不用扣积分
|
|
useSLTimes := false // 使用留资机会的下载次数
|
|
useSLTimes := false // 使用留资机会的下载次数
|
|
//查询文档所需积分及文档类型
|
|
//查询文档所需积分及文档类型
|
|
- docInfo, isBuy, _, err := rpc.GetDocDetail(userId, docId)
|
|
|
|
|
|
+ docInfo, isBuy, _, err := rpc.GetDocDetail(userId, docId, true)
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
@@ -119,7 +119,7 @@ func (userDoc *UserDoc) DocBuy() {
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
- docMemberStatus := docMember["docMemberStatus"].(bool)
|
|
|
|
|
|
+ docMemberStatus := docMember["docMemberStatus"].(bool)
|
|
freeDownload := common.IntAll(docMember["free_download"])
|
|
freeDownload := common.IntAll(docMember["free_download"])
|
|
surplus, use := 0, 0 // 今日下载剩余次数,今日消耗次数
|
|
surplus, use := 0, 0 // 今日下载剩余次数,今日消耗次数
|
|
if docMemberStatus {
|
|
if docMemberStatus {
|
|
@@ -198,7 +198,7 @@ func (userDoc *UserDoc) DocBuy() {
|
|
// 没有ossdocId 说明是还没有下过的 需要先获得地址
|
|
// 没有ossdocId 说明是还没有下过的 需要先获得地址
|
|
if docInfo.OssDocId == "" {
|
|
if docInfo.OssDocId == "" {
|
|
// 如果是精品 则需要先调购买接口
|
|
// 如果是精品 则需要先调购买接口
|
|
- if docInfo.ProductType == public.ProductTypePremium {
|
|
|
|
|
|
+ if docInfo.ProductType == public.ProductTypePremium && docInfo.Source == public.SourceDd {
|
|
_, err2 := rpc.PartUserBuy(docId, userInfo.MgoUserId, userInfo.Phone, userInfo.PositionId)
|
|
_, err2 := rpc.PartUserBuy(docId, userInfo.MgoUserId, userInfo.Phone, userInfo.PositionId)
|
|
if err2 != nil {
|
|
if err2 != nil {
|
|
return nil, fmt.Errorf("获取失败")
|
|
return nil, fmt.Errorf("获取失败")
|