|
@@ -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("获取用户抽奖记录失败"))
|