Browse Source

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

zjxpcyc 6 years ago
parent
commit
b638ec5538
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      controllers/luckdraw/luckdraw.go

+ 8
- 2
controllers/luckdraw/luckdraw.go View File

99
 
99
 
100
 // GetUserLuckDraw 获取用户的抽奖记录
100
 // GetUserLuckDraw 获取用户的抽奖记录
101
 func (c *LuckDrawController) GetUserLuckDraw() {
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
 	if err != nil {
110
 	if err != nil {
105
 		utils.LogError("获取用户抽奖记录失败: " + err.Error())
111
 		utils.LogError("获取用户抽奖记录失败: " + err.Error())
106
 		c.ResponseError(errors.New("获取用户抽奖记录失败"))
112
 		c.ResponseError(errors.New("获取用户抽奖记录失败"))