Commit deeb57a3 authored by vicotor's avatar vicotor

profile user history query

parent 927e42b6
......@@ -170,7 +170,7 @@ func (d *Dao) GetHistoryInfo(user string) (history apiModel.History, err error)
completedHistory := make([]*apiModel.HistoryInfo, 0, 1000)
for _, event := range events {
if event.FromChainTxHash == "" || event.ToChainTxHash == "" {
if event.FromChainTxHash == "" {
continue
}
fromChain, _ := d.chainList.Get(event.FromChain)
......@@ -194,8 +194,10 @@ func (d *Dao) GetHistoryInfo(user string) (history apiModel.History, err error)
if event.ToChainStatus <= int(constant.TransferChainWaitConfirm) {
pendingHistory = append(pendingHistory, record)
} else {
record.UrlTarget = toChain.Explorer + "/tx/" + event.ToChainTxHash
completedHistory = append(completedHistory, record)
if event.ToChainTxHash != "" {
record.UrlTarget = toChain.Explorer + "/tx/" + event.ToChainTxHash
completedHistory = append(completedHistory, record)
}
}
}
// sort pending by CreateTime desc
......@@ -211,7 +213,6 @@ func (d *Dao) GetHistoryInfo(user string) (history apiModel.History, err error)
history.Finish = completedHistory
return history, nil
}
type tokenBalance struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment