1.完善商城订单退货流程,新机预售券退货时需要将优惠券状态改为4-已失效;
This commit is contained in:
parent
02a094445c
commit
1e7557bd79
|
@ -1365,6 +1365,18 @@ func (r *GoodsOrderRefundSendReceiveReq) Receive() error {
|
||||||
log.Error().Msgf("goods stock back err:%#v", err)
|
log.Error().Msgf("goods stock back err:%#v", err)
|
||||||
return 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
|
err = begin.Commit().Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
begin.Rollback()
|
begin.Rollback()
|
||||||
|
|
|
@ -213,15 +213,15 @@ const (
|
||||||
// gen:qs
|
// gen:qs
|
||||||
type FundRecord struct {
|
type FundRecord struct {
|
||||||
Model
|
Model
|
||||||
Uid uint32 `json:"uid" gorm:"index"`
|
Uid uint32 `json:"uid" gorm:"index"` //
|
||||||
FundType string `json:"fund_type" gorm:"index"` // -member_gold -member_platinum -member_black_gold
|
FundType string `json:"fund_type" gorm:"index"` // -member_gold -member_platinum -member_black_gold
|
||||||
Amount int64 `json:"amount"`
|
Amount int64 `json:"amount"` //
|
||||||
TransactionId string `json:"transaction_id" gorm:"index"` // 支付单号
|
TransactionId string `json:"transaction_id" gorm:"index"` // 支付单号
|
||||||
OutTradeNo string `json:"out_trade_no" gorm:"index"`
|
OutTradeNo string `json:"out_trade_no" gorm:"index"` //
|
||||||
RefundId string `json:"refund_id" gorm:"index"`
|
RefundId string `json:"refund_id" gorm:"index"` //
|
||||||
PaymentNo string `json:"payment_no" gorm:"index"` // 付款单号
|
PaymentNo string `json:"payment_no" gorm:"index"` // 付款单号
|
||||||
Status uint32 `json:"status"` // 1-待支付 2-已支付 3-已退款
|
Status uint32 `json:"status"` // 1-待支付 2-已支付 3-已退款
|
||||||
Remark string `json:"remark"` // 备注
|
Remark string `json:"remark"` // 备注
|
||||||
|
|
||||||
// fund_record
|
// fund_record
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user