作者 陈志颖

feat:添加现金池兑换活动,兑换清单更新方法

... ... @@ -32,9 +32,25 @@ func (exchangeCashActivity *ExchangeCashActivity) Identity() interface{} {
return exchangeCashActivity.ActivityId
}
// TODO
func (exchangeCashActivity *ExchangeCashActivity) Update(data map[string]interface{}) error {
if exchangeActivityName, ok := data["exchangeActivityName"]; ok && exchangeActivityName != "" {
exchangeCashActivity.ExchangeActivityName = exchangeActivityName.(string)
}
if deadline, ok := data["deadline"]; ok && deadline != "" {
exchangeCashActivity.Deadline = deadline.(time.Time)
}
if countDown, ok := data["countDown"]; ok && countDown != 0 {
exchangeCashActivity.CountDown = countDown.(int64)
}
if exchangedSuMoney, ok := data["exchangedSuMoney"]; ok && exchangedSuMoney != 0 {
exchangeCashActivity.ExchangedSuMoney = exchangedSuMoney.(float64)
}
if exchangedCash, ok := data["exchangedCash"]; ok && exchangedCash != 0 {
exchangeCashActivity.ExchangedCash = exchangedCash.(float64)
}
if exchangeRate, ok := data["exchangeRate"]; ok && exchangeRate != 0 {
exchangeCashActivity.Rate = exchangeRate.(float64)
}
return nil
}
... ...
... ... @@ -24,8 +24,12 @@ func (exchangeCashPersonList *ExchangeCashPersonList) Identity() interface{} {
return exchangeCashPersonList.ExchangeCashPersonListId
}
// TODO
func (exchangeCashPersonList *ExchangeCashPersonList) Update(data map[string]interface{}) error {
if exchangedSuMoney, ok := data["exchangedSuMoney"]; ok && exchangedSuMoney != 0 {
exchangeCashPersonList.ExchangedSuMoney = exchangedSuMoney.(float64)
}
if exchangedCash, ok := data["exchangedCash"]; ok && exchangedCash != 0 {
exchangeCashPersonList.ExchangedCash = exchangedCash.(float64)
}
return nil
}
\ No newline at end of file
... ...