Commit 13ff203f authored by hujiebin's avatar hujiebin

fix:bagId

parent 8323ee27
......@@ -5,6 +5,7 @@ import (
)
type UserBag struct {
BagId mysql.ID `json:"bagId"` // 背包id
ResType mysql.Type `json:"resType"` // 道具类型 1:礼物道具
ResId mysql.ID `json:"resId"` // 道具资源id
Name string `json:"name"` // 资源名称
......
......@@ -27,6 +27,7 @@ func GetUserValidUserBag(model *domain.Model, userId mysql.ID, resType res_e.Res
if err := model.DB().Model(UserBag{}).
Where("end_time > ?", time.Now()).
Where("count > 0").
Where("res_type = ?", resType).
Where("user_id = ?", userId).Find(&res).Error; err != nil {
return nil, err
}
......
......@@ -45,6 +45,7 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
for _, bagGift := range userBagGifts {
if gift, ok := allValidGifts[bagGift.ResId]; ok {
results = append(results, user_cv.UserBag{
BagId: bagGift.ID,
ResType: res_e.ResUserBagGift,
ResId: gift.ID,
Name: gift.Name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment