优化钱包界面:改名积分明细,添加筛选功能,优化表格列宽

- 侧边栏和页面标题改为'积分明细'
- 新增关联单号、收支类型筛选功能
- 后端 ledger API 支持 reference_no 和 type 筛选参数
- 表格列宽优化,流水号完整展示,备注列限制宽度
- 隐藏固定 tab 模式下的商户介绍文字
This commit is contained in:
yml2213
2026-07-31 20:18:06 +08:00
parent 8672ab2dca
commit 9a3471cc61
5 changed files with 76 additions and 19 deletions
+3 -1
View File
@@ -204,7 +204,9 @@ func (h *MerchantHandler) GetWallet(c *gin.Context) {
func (h *MerchantHandler) ListWalletLedger(c *gin.Context) {
page, size := pageParams(c)
list, total, err := h.fulfillmentSvc.ListWalletLedger(middleware.GetMerchantID(c), page, size)
referenceNo := c.Query("reference_no")
entryType := c.Query("type")
list, total, err := h.fulfillmentSvc.ListWalletLedger(middleware.GetMerchantID(c), page, size, referenceNo, entryType)
if err != nil {
response.ServerError(c, err.Error())
return
+7 -1
View File
@@ -694,9 +694,15 @@ func (s *FulfillmentService) GetWallet(merchantID uint) (*model.WalletAccount, e
return &wallet, nil
}
func (s *FulfillmentService) ListWalletLedger(merchantID uint, page, size int) ([]model.WalletLedgerEntry, int64, error) {
func (s *FulfillmentService) ListWalletLedger(merchantID uint, page, size int, referenceNo, entryType string) ([]model.WalletLedgerEntry, int64, error) {
page, size = normalizePage(page, size)
tx := s.db.Model(&model.WalletLedgerEntry{}).Where("merchant_id = ?", merchantID)
if referenceNo != "" {
tx = tx.Where("reference_no LIKE ?", "%"+referenceNo+"%")
}
if entryType != "" {
tx = tx.Where("type = ?", entryType)
}
var total int64
if err := tx.Count(&total).Error; err != nil {
return nil, 0, err