update
This commit is contained in:
parent
2f90ee9e17
commit
1a9bca31ba
|
|
@ -49,6 +49,9 @@ func (p DefParty) goodsList() web_iris.Party {
|
|||
PetNotExistError.Fail(ctx, goodsListRequest)
|
||||
return
|
||||
}
|
||||
if userInfo.Role == 1 {
|
||||
userPetInfo = GetPet(goodsListRequest.Pid)
|
||||
}
|
||||
//先取默认的商品
|
||||
key := "0" + strconv.Itoa(userPetInfo.PetBaseInfo.PetType) + "0" + "0"
|
||||
goodsList := getPetGoodsList(key)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,12 @@ func GetUserPet(uId int64, pId int64) UserPetInfo {
|
|||
return UserPetInfo{userPet, PetBaseInfoMap[userPet.PetId]}
|
||||
}
|
||||
|
||||
func GetPet(pId int64) UserPetInfo {
|
||||
var userPet models.Pet
|
||||
database.Instance().Model(&models.Pet{}).Where("id = ? and status = 1", pId).Find(&userPet)
|
||||
return UserPetInfo{userPet, PetBaseInfoMap[userPet.PetId]}
|
||||
}
|
||||
|
||||
type PetListResponse struct {
|
||||
UserPets []UserPetInfo `json:"userPets"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue