解决商户审核通过 bug
This commit is contained in:
@ -52,13 +52,18 @@ func (s *sMerchant) Audit(ctx context.Context, in *model.MerchantAuditIn) (out *
|
|||||||
if merchant[dao.Merchants.Columns().AuditStatus].Int() != 1 {
|
if merchant[dao.Merchants.Columns().AuditStatus].Int() != 1 {
|
||||||
return nil, ecode.Params.Sub("商户已审核")
|
return nil, ecode.Params.Sub("商户已审核")
|
||||||
}
|
}
|
||||||
|
status := 2
|
||||||
|
if in.AuditStatus == 2 {
|
||||||
|
status = 1
|
||||||
|
}
|
||||||
if err = dao.Merchants.Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
|
if err = dao.Merchants.Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
|
||||||
if _, err = tx.Model(dao.Merchants.Table()).WherePri(in.Id).Data(do.Merchants{
|
if _, err = tx.Model(dao.Merchants.Table()).WherePri(in.Id).Data(do.Merchants{
|
||||||
AuditBy: in.AdminId,
|
AuditBy: in.AdminId,
|
||||||
AuditRemark: in.AuditRemark,
|
AuditRemark: in.AuditRemark,
|
||||||
AuditStatus: in.AuditStatus,
|
AuditStatus: in.AuditStatus,
|
||||||
AuditAt: gtime.Now(),
|
AuditAt: gtime.Now(),
|
||||||
Status: in.AuditStatus, // 暂定审核通过商户即可使用
|
ExpireAt: gtime.Now().AddDate(1, 0, 0), // 暂定审核通过后1年
|
||||||
|
Status: status, // 暂定审核通过商户即可使用
|
||||||
RejectReason: in.RejectReason,
|
RejectReason: in.RejectReason,
|
||||||
}).OmitEmptyData().Update(); err != nil {
|
}).OmitEmptyData().Update(); err != nil {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user