From 9c986d3c87c0569b1ab17d3fa37ad0531c103a0a Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Sat, 23 Nov 2024 14:48:39 +0800 Subject: [PATCH] update --- src/implement/user_virtual_coin_flow_implement.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/implement/user_virtual_coin_flow_implement.go b/src/implement/user_virtual_coin_flow_implement.go index a4be0b6..85fa321 100644 --- a/src/implement/user_virtual_coin_flow_implement.go +++ b/src/implement/user_virtual_coin_flow_implement.go @@ -24,7 +24,10 @@ func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowInsertBySession(session *xorm. 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) + session := u.Db.Where("uid = ?", uid) + if coinID > 0 { + session = session.And("coin_id = ?", coinID) + } if startAt != "" && endAt != "" { session = session.And("create_at >= ?", startAt).And("create_at <= ?", endAt) }