作者 陈志颖

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

@@ -32,9 +32,25 @@ func (exchangeCashActivity *ExchangeCashActivity) Identity() interface{} { @@ -32,9 +32,25 @@ func (exchangeCashActivity *ExchangeCashActivity) Identity() interface{} {
32 return exchangeCashActivity.ActivityId 32 return exchangeCashActivity.ActivityId
33 } 33 }
34 34
35 -// TODO  
36 func (exchangeCashActivity *ExchangeCashActivity) Update(data map[string]interface{}) error { 35 func (exchangeCashActivity *ExchangeCashActivity) Update(data map[string]interface{}) error {
37 - 36 + if exchangeActivityName, ok := data["exchangeActivityName"]; ok && exchangeActivityName != "" {
  37 + exchangeCashActivity.ExchangeActivityName = exchangeActivityName.(string)
  38 + }
  39 + if deadline, ok := data["deadline"]; ok && deadline != "" {
  40 + exchangeCashActivity.Deadline = deadline.(time.Time)
  41 + }
  42 + if countDown, ok := data["countDown"]; ok && countDown != 0 {
  43 + exchangeCashActivity.CountDown = countDown.(int64)
  44 + }
  45 + if exchangedSuMoney, ok := data["exchangedSuMoney"]; ok && exchangedSuMoney != 0 {
  46 + exchangeCashActivity.ExchangedSuMoney = exchangedSuMoney.(float64)
  47 + }
  48 + if exchangedCash, ok := data["exchangedCash"]; ok && exchangedCash != 0 {
  49 + exchangeCashActivity.ExchangedCash = exchangedCash.(float64)
  50 + }
  51 + if exchangeRate, ok := data["exchangeRate"]; ok && exchangeRate != 0 {
  52 + exchangeCashActivity.Rate = exchangeRate.(float64)
  53 + }
38 return nil 54 return nil
39 } 55 }
40 56
@@ -24,8 +24,12 @@ func (exchangeCashPersonList *ExchangeCashPersonList) Identity() interface{} { @@ -24,8 +24,12 @@ func (exchangeCashPersonList *ExchangeCashPersonList) Identity() interface{} {
24 return exchangeCashPersonList.ExchangeCashPersonListId 24 return exchangeCashPersonList.ExchangeCashPersonListId
25 } 25 }
26 26
27 -// TODO  
28 func (exchangeCashPersonList *ExchangeCashPersonList) Update(data map[string]interface{}) error { 27 func (exchangeCashPersonList *ExchangeCashPersonList) Update(data map[string]interface{}) error {
29 - 28 + if exchangedSuMoney, ok := data["exchangedSuMoney"]; ok && exchangedSuMoney != 0 {
  29 + exchangeCashPersonList.ExchangedSuMoney = exchangedSuMoney.(float64)
  30 + }
  31 + if exchangedCash, ok := data["exchangedCash"]; ok && exchangedCash != 0 {
  32 + exchangeCashPersonList.ExchangedCash = exchangedCash.(float64)
  33 + }
30 return nil 34 return nil
31 } 35 }