Browse Source

no message

xingzai 6 months ago
parent
commit
ed4f268db0
1 changed files with 7 additions and 3 deletions
  1. 7 3
      services/order.go

+ 7 - 3
services/order.go

@@ -134,6 +134,9 @@ func GetGoodsInfoByActivityVivo(item *models.ActivityDetail) (goodsListResp []*o
 }
 
 func GetActivityVivoPoints(item *models.ActivityDetail, wxUser *models.WxUserItem, havePower bool) (vivoPointsResp models.VivoPointsResp) {
+	if wxUser.UserId == 0 {
+		return
+	}
 	var err error
 	defer func() {
 		if err != nil {
@@ -148,7 +151,8 @@ func GetActivityVivoPoints(item *models.ActivityDetail, wxUser *models.WxUserIte
 		err = errors.New("GetCygxActivityPointsSetUserNum, Err: " + e.Error())
 		return
 	}
-	if total == 0 {
+
+	if total == 0 && havePower {
 		//如果没有设置就直接播放
 		vivoPointsResp.HavePoint = true
 		return
@@ -156,13 +160,13 @@ func GetActivityVivoPoints(item *models.ActivityDetail, wxUser *models.WxUserIte
 
 	totalMySuccess, e := models.GetActivitySignupCount(wxUser.UserId, activityId)
 	if e != nil {
-		err = errors.New("GetCygxActivityPointsSetUserNum, Err: " + e.Error())
+		err = errors.New("GetActivitySignupCount, Err: " + e.Error())
 		return
 	}
 
 	totalPayVivo, e := order.GetCygxOrderVirtualAssetdCountByVivo(activityId, wxUser.UserId)
 	if e != nil {
-		err = errors.New("GetCygxActivityPointsSetUserNum, Err: " + e.Error())
+		err = errors.New("GetCygxOrderVirtualAssetdCountByVivo, Err: " + e.Error())
 		return
 	}