调整表结构
This commit is contained in:
@ -17,6 +17,7 @@ import (
|
||||
"server/utility/ecode"
|
||||
utility "server/utility/encrypt"
|
||||
"server/utility/jwt"
|
||||
"server/utility/snowid"
|
||||
)
|
||||
|
||||
type sMerchantAdmin struct {
|
||||
@ -150,8 +151,13 @@ func (s *sMerchantAdmin) Register(ctx context.Context, in *model.MerchantAdminRe
|
||||
}
|
||||
if err = dao.MerchantAdmins.Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
|
||||
// 插入商户数据
|
||||
generateCode, err := snowid.GetSnowClient().GenerateMerchantCode()
|
||||
if err != nil {
|
||||
return ecode.Fail.Sub("生成商户编号失败")
|
||||
}
|
||||
id, err := tx.Model(dao.Merchants.Table()).Data(do.Merchants{
|
||||
Name: fmt.Sprintf("%s的商铺", in.Username),
|
||||
MerchantCode: generateCode,
|
||||
Name: fmt.Sprintf("%s代理", in.Username),
|
||||
CreatedByType: consts.MerchantRegisterByAdmin,
|
||||
Status: consts.MerchantDisabledStatus,
|
||||
AuditStatus: consts.MerchantPendingReview,
|
||||
|
||||
Reference in New Issue
Block a user