明细 时间倒序

This commit is contained in:
lwl0608 2024-03-19 10:20:50 +08:00
parent d92fe95c31
commit 184a3ff5e2
3 changed files with 6 additions and 3 deletions

View File

@ -736,7 +736,7 @@ func (m *Mysql) GetUnlockWechatList(ctx *gin.Context, tx *sqlx.Tx, mid int64, of
func (m *Mysql) GetUCHList(ctx *gin.Context, tx *sqlx.Tx, mid int64, typ int32, offset, limit int) (list []*dbstruct.ConsumeHistory, err error) {
list = make([]*dbstruct.ConsumeHistory, 0)
tableName, err := m.ChTableName(&dbstruct.ConsumeHistory{Type: goproto.Int32(typ)})
sqlStr := fmt.Sprintf("select * from %s where mid=? limit ? offset ?", tableName)
sqlStr := fmt.Sprintf("select * from %s where mid=? order by ct desc limit ? offset ?", tableName)
if tx != nil {
err = tx.SelectContext(ctx, &list, sqlStr, mid, limit, offset)
} else {

View File

@ -257,7 +257,7 @@ func (s *Service) chListCost(ctx *gin.Context, chList []*dbstruct.ConsumeHistory
}
case dbstruct.CHSTypeCostRefundMembership:
item.Desc = fmt.Sprintf("会员退款")
item.Change = fmt.Sprintf("%d金币", chDB.GetChange())
item.Change = changeMark + fmt.Sprintf("%d金币", chDB.GetChange())
}
list = append(list, item)
}

View File

@ -61,13 +61,17 @@ CREATE TABLE `vas_ch_income`
);
CREATE INDEX mid_ct ON vas_ch_cost (mid, ct);
CREATE INDEX uid_ct ON vas_ch_cost (uid, ct);
CREATE INDEX ix_orderid ON vas_ch_cost (order_id);
CREATE INDEX mid_ct ON vas_ch_charge (mid, ct);
CREATE INDEX uid_ct ON vas_ch_charge (uid, ct);
CREATE INDEX ix_orderid ON vas_ch_charge (order_id);
CREATE INDEX mid_ct ON vas_ch_income (mid, ct);
CREATE INDEX uid_ct ON vas_ch_income (uid, ct);
CREATE INDEX ix_orderid ON vas_ch_income (order_id);
CREATE INDEX mid_ct ON vas_ch_withdraw (mid, ct);
CREATE INDEX uid_ct ON vas_ch_withdraw (uid, ct);
CREATE INDEX ix_orderid ON vas_ch_withdraw (order_id);
CREATE TABLE `vas_coin_order`
(
@ -119,7 +123,6 @@ CREATE TABLE `vas_user_unlock`
);
CREATE INDEX mid_uid_product_id ON vas_user_unlock (mid, uid, product_id);
CREATE TABLE `vas_withdraw_order`
(
`id` varchar(128) NOT NULL COMMENT '订单id',