|
|
@@ -22,7 +22,7 @@ func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowInsertBySession(session *xorm. |
|
|
|
return UserVirtualCoinFlow.Id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowFindByCoinAndUser(page, pageSize int, coinID int, uid int64, startAt string, endAt string, direction int, isAsc bool) ([]model.UserVirtualCoinFlow, int64, error) { |
|
|
|
func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowFindByCoinAndUser(page, pageSize int, coinID int, uid int64, startAt string, endAt string, direction int, isAsc bool, transferType int) ([]model.UserVirtualCoinFlow, int64, error) { |
|
|
|
var m []model.UserVirtualCoinFlow |
|
|
|
session := u.Db.Where("uid = ?", uid).And("coin_id = ?", coinID) |
|
|
|
if startAt != "" && endAt != "" { |
|
|
@@ -31,6 +31,9 @@ func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowFindByCoinAndUser(page, pageSi |
|
|
|
if direction != 0 { |
|
|
|
session = session.And("direction = ?", direction) |
|
|
|
} |
|
|
|
if transferType != 0{ |
|
|
|
session = session.And("type = ?", type) |
|
|
|
} |
|
|
|
session = session.Limit(pageSize, (page-1)*pageSize) |
|
|
|
if isAsc { |
|
|
|
session = session.Asc("create_at") |
|
|
|