...
|
...
|
@@ -268,7 +268,7 @@ func (c *AuditController) ChanceReserveTypeList() { |
|
|
}
|
|
|
companyId := c.GetCompanyId()
|
|
|
list := serveaudit.GetReserveTypeLsit(param.PageIndex, param.PageSize, companyId)
|
|
|
msg = protocol.NewReturnResponse(list, nil)
|
|
|
msg = protocol.NewPageDataResponse(list, nil)
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
@@ -330,3 +330,37 @@ func (c *AuditController) DeleteReserveType() { |
|
|
msg = protocol.NewReturnResponse(nil, err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//ChanceStoreChange 机会数据变更存储类型
|
|
|
//@router /v1/chance/store/change
|
|
|
func (c *AuditController) ChanceStoreChange() {
|
|
|
var msg *protocol.ResponseMessage
|
|
|
defer func() {
|
|
|
c.ResposeJson(msg)
|
|
|
}()
|
|
|
type Parameter struct {
|
|
|
ChanceId string `json:"chance_id"`
|
|
|
StoreType int8 `json:"store_type"`
|
|
|
}
|
|
|
var param Parameter
|
|
|
if err := json.Unmarshal(c.Ctx.Input.RequestBody, ¶m); err != nil {
|
|
|
log.Error("json 解析失败", err)
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
// companyId := c.GetCompanyId()
|
|
|
var (
|
|
|
chanceData *models.Chance
|
|
|
err error
|
|
|
)
|
|
|
chanceId, _ := strconv.ParseInt(param.ChanceId, 64, 10)
|
|
|
chanceData, err = models.GetChanceById(chanceId)
|
|
|
if err != nil {
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
chanceData.StoreType = param.StoreType
|
|
|
err = models.UpdateChanceById(chanceData, []string{"StoreType"})
|
|
|
msg = protocol.NewReturnResponse(nil, nil)
|
|
|
return
|
|
|
} |
...
|
...
|
|