1.完善商城订单退货流程,新机预售券退货时需要将优惠券状态改为4-已失效;

This commit is contained in:
chenlin 2025-01-22 16:59:04 +08:00
parent 02a094445c
commit 1e7557bd79
2 changed files with 20 additions and 8 deletions

View File

@ -1365,6 +1365,18 @@ func (r *GoodsOrderRefundSendReceiveReq) Receive() error {
log.Error().Msgf("goods stock back err:%#v", err)
return err
}
if goodsOrder.Amount == 0 { // 目前只有主机预售券可以退款;普通的积分兑换不支持退货
err = begin.Table("user_coupon").Where("uid = ? and activity_id = ?", goodsOrder.Uid, 10).
Updates(map[string]interface{}{
"state": 4,
"updated_at": time.Now(),
}).Error
if err != nil {
begin.Rollback()
log.Error().Msgf("update state err:%#v", err)
return err
}
}
err = begin.Commit().Error
if err != nil {
begin.Rollback()

View File

@ -213,15 +213,15 @@ const (
// gen:qs
type FundRecord struct {
Model
Uid uint32 `json:"uid" gorm:"index"`
FundType string `json:"fund_type" gorm:"index"` // -member_gold -member_platinum -member_black_gold
Amount int64 `json:"amount"`
Uid uint32 `json:"uid" gorm:"index"` //
FundType string `json:"fund_type" gorm:"index"` // -member_gold -member_platinum -member_black_gold
Amount int64 `json:"amount"` //
TransactionId string `json:"transaction_id" gorm:"index"` // 支付单号
OutTradeNo string `json:"out_trade_no" gorm:"index"`
RefundId string `json:"refund_id" gorm:"index"`
PaymentNo string `json:"payment_no" gorm:"index"` // 付款单号
Status uint32 `json:"status"` // 1-待支付 2-已支付 3-已退款
Remark string `json:"remark"` // 备注
OutTradeNo string `json:"out_trade_no" gorm:"index"` //
RefundId string `json:"refund_id" gorm:"index"` //
PaymentNo string `json:"payment_no" gorm:"index"` // 付款单号
Status uint32 `json:"status"` // 1-待支付 2-已支付 3-已退款
Remark string `json:"remark"` // 备注
// fund_record
}