作者 tangxvhui

bug 修复

... ... @@ -340,8 +340,9 @@ func (c *AuditController) ChanceStoreChange() {
c.ResposeJson(msg)
}()
type Parameter struct {
ChanceId string `json:"chance_id"`
StoreType int8 `json:"store_type"`
ChanceId string `json:"chance_id"`
StoreType int8 `json:"store_type"`
ReserveType int `json:"reserve_type"`
}
var param Parameter
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &param); err != nil {
... ... @@ -367,7 +368,8 @@ func (c *AuditController) ChanceStoreChange() {
return
}
chanceData.StoreType = param.StoreType
err = models.UpdateChanceById(chanceData, []string{"StoreType"})
chanceData.ReserveTypeId = param.ReserveType
err = models.UpdateChanceById(chanceData, []string{"StoreType", "ReserveTypeId"})
msg = protocol.NewReturnResponse(nil, nil)
return
}
... ...
... ... @@ -33,7 +33,6 @@ func GetReserveTypeLsit(pageIndex int, pageSize int, companyid int64) protocol.R
first := (pageIndex - 1) * pageSize
_, err = o.QueryTable(&models.ChanceReserveType{}).
Filter("company_id", companyid).
OrderBy("-create_at").
Limit(pageSize, first).
All(&allData)
if err != nil {
... ...