浏览代码

fix:修改我的奖励接口

xuemingyang 3 年之前
父节点
当前提交
9a439c629c
共有 5 个文件被更改,包括 24 次插入7 次删除
  1. 2 0
      config/config.go
  2. 4 2
      etc/push.json
  3. 2 2
      handler/activity/bidderPlan.go
  4. 13 1
      handler/award/record.go
  5. 3 2
      services/activity/award/service.go

+ 2 - 0
config/config.go

@@ -60,6 +60,8 @@ type pushConfig struct {
 	} `json:"wxTplMsg"`
 	TestId      string `json:"testId"`
 	DelayedTime int    `json:"delayedTime"`
+	Subvip      string `json:"subvip"`
+	Points      string `json:"points"`
 }
 
 type SysConfig struct {

+ 4 - 2
etc/push.json

@@ -1,5 +1,5 @@
 {
-  "webdomain": "https://web2-jytest.jydev.jianyu360.com",
+  "webdomain": "https://jybx2-webtest.jydev.jianyu360.com",
   "weixinrpc": "127.0.0.1:8083",
   "pushPoolSize": 5,
   "wxTplMsg": {
@@ -30,5 +30,7 @@
     }
   },
   "testId": "o7Y1g0Rz_1JmNep3lnIU4lfjeooI",
-  "delayedTime": 5
+  "delayedTime": 5,
+  "subvip": "天超级订阅",
+  "points": "剑鱼币"
 }

+ 2 - 2
handler/activity/bidderPlan.go

@@ -255,7 +255,7 @@ func (BP *BidderPlan) MissionsInviteGiven(userId string) error {
 		Num:          gcfg.Instance().MustGet(gctx.New(), "bidderPlan.missions.invite.points").Int64(),
 		Type:         1008,
 		ActivityCode: BidderPlanActivityCode,
-		Desc:         "邀请领好礼任务完成",
+		Desc:         "邀请领好礼任务",
 		Date:         time.Now().Unix(),
 	}); givenPointsErr != nil {
 		return fmt.Errorf("领取奖励异常")
@@ -304,7 +304,7 @@ func (BP *BidderPlan) MissionsImproveInfoGiven(userId string) error {
 		Num:          gcfg.Instance().MustGet(gctx.New(), "bidderPlan.missions.improveInfo.points").Int64(),
 		Type:         1009,
 		ActivityCode: BidderPlanActivityCode,
-		Desc:         "完善信息任务完成",
+		Desc:         "完善信息任务",
 		Date:         time.Now().Unix(),
 	}); givenPointsErr != nil {
 		return fmt.Errorf("领取奖励异常")

+ 13 - 1
handler/award/record.go

@@ -2,6 +2,7 @@ package award
 
 import (
 	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/message/config"
 	"app.yhyue.com/moapp/message/db"
 )
 
@@ -53,6 +54,17 @@ func GetActivityAwardList(userId, activityCode, award string, pageSize, pageNum
 	}
 	data, _ := db.Mgo.Find("activity_award", q, `{"date":-1}`, `{"activity_code":1,"award":1,"date":1,"getway":1,"num":1}`, false, pageNum*pageSize, pageSize)
 	total = db.Mgo.Count("activity_award", q)
-	hasNext = (pageNum+1)*pageSize < total
+	if pageSize != -1 {
+		hasNext = (pageNum+1)*pageSize < total
+	} else {
+		hasNext = false
+	}
+	for _, v := range *data {
+		if v["award"] == "subvip" {
+			v["award"] = common.InterfaceToStr(v["num"]) + config.PushConfig.Subvip
+		} else if v["award"] == "points" {
+			v["award"] = common.InterfaceToStr(v["num"]) + config.PushConfig.Points
+		}
+	}
 	return *data, total, hasNext
 }

+ 3 - 2
services/activity/award/service.go

@@ -15,8 +15,9 @@ func (a AwardRouter) Awardlist(r *ghttp.Request) {
 	aw := r.Get("award").String()
 	pSize := r.Get("pageSize").Int()
 	pNum := r.Get("pageNum").Int()
-	if pSize == 0 {
-		pSize = 5
+	if pSize == 0 && pNum == 0 {
+		pSize = -1
+		pNum = 1
 	}
 	data, total, hasNext := award.GetActivityAwardList(userid, code, aw, pSize, pNum)
 	rdata["list"] = data