Przeglądaj źródła

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/services into dev

zjxpcyc 6 lat temu
rodzic
commit
b638ec5538
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8
    2
      controllers/luckdraw/luckdraw.go

+ 8
- 2
controllers/luckdraw/luckdraw.go Wyświetl plik

@@ -99,8 +99,14 @@ func (c *LuckDrawController) GetRecordByLuckDraw() {
99 99
 
100 100
 // GetUserLuckDraw 获取用户的抽奖记录
101 101
 func (c *LuckDrawController) GetUserLuckDraw() {
102
-	userid := c.GetString("userid")
103
-	records, err := c.serv.GetUserLuckDraw(userid)
102
+	userRaw := c.Context.Get("customer")
103
+	if userRaw == nil {
104
+		c.ResponseError(errors.New("系统内部错误"), http.StatusInternalServerError)
105
+	}
106
+
107
+	user := userRaw.(model.TaCustomer)
108
+
109
+	records, err := c.serv.GetUserLuckDraw(user.CustomerId)
104 110
 	if err != nil {
105 111
 		utils.LogError("获取用户抽奖记录失败: " + err.Error())
106 112
 		c.ResponseError(errors.New("获取用户抽奖记录失败"))