新增摸大红业务并修复后台链接按钮白字
支持分类筛选、搜索、下单支付建群与固定二维码;合并迁移种子数据;后台表格编辑/详情链接恢复主题色可见。
This commit is contained in:
@@ -45,16 +45,31 @@ func isOrderPaymentTerminalStatus(status string) bool {
|
||||
}
|
||||
func (r *Repository) confirmPaid(ctx context.Context, payment *model.PaymentOrder, status string, paidAt time.Time, raw map[string]string, source string) error {
|
||||
var newConvID uint64
|
||||
var notifyFn func(uint64)
|
||||
err := r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
if payment.OrderID != 0 {
|
||||
if r.orderRepo == nil {
|
||||
return ErrDependencyUnavailable
|
||||
switch payment.BizType {
|
||||
case "mohong_pay":
|
||||
if r.mohongRepo == nil {
|
||||
return ErrDependencyUnavailable
|
||||
}
|
||||
convID, err := r.mohongRepo.ConfirmPaidFromChannelTx(tx, payment.OrderID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newConvID = convID
|
||||
notifyFn = r.mohongRepo.NotifyNewConversation
|
||||
default:
|
||||
if r.orderRepo == nil {
|
||||
return ErrDependencyUnavailable
|
||||
}
|
||||
convID, err := r.orderRepo.ConfirmPaidFromChannelTx(tx, payment.OrderID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newConvID = convID
|
||||
notifyFn = r.orderRepo.NotifyNewConversation
|
||||
}
|
||||
convID, err := r.orderRepo.ConfirmPaidFromChannelTx(tx, payment.OrderID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newConvID = convID
|
||||
}
|
||||
|
||||
var latest model.PaymentOrder
|
||||
@@ -75,8 +90,8 @@ func (r *Repository) confirmPaid(ctx context.Context, payment *model.PaymentOrde
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if newConvID > 0 && r.orderRepo != nil {
|
||||
r.orderRepo.NotifyNewConversation(newConvID)
|
||||
if newConvID > 0 && notifyFn != nil {
|
||||
notifyFn(newConvID)
|
||||
}
|
||||
if latest, err := r.findPaymentByID(ctx, payment.ID); err == nil {
|
||||
if runtimeConfig, err := r.runtimeConfigForPayment(ctx, latest); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user