调整商户管理表

This commit is contained in:
2025-06-11 16:01:00 +08:00
parent 82d8944e7a
commit ed243f4e9d
10 changed files with 32 additions and 30 deletions

View File

@ -86,15 +86,11 @@ func (s *sMerchantAdmin) Login(ctx context.Context, in *model.MerchantLoginIn) (
LastLoginAt: gtime.Now(),
LastLoginIp: ghttp.RequestFromCtx(ctx).RemoteAddr,
})
}(ctx, mAdminId)
}(context.Background(), mAdminId)
return
}
func (s *sMerchantAdmin) Info(ctx context.Context, in *model.MerchantAdminInfoIn) (out *model.MerchantAdminInfoOut, err error) {
one, err := dao.MerchantAdmins.Ctx(ctx).WherePri(in.MerchantAdminId).
LeftJoin(
dao.Stores.Table(),
fmt.Sprintf("%s.%s = %s.%s", dao.Stores.Table(), dao.Stores.Columns().MerchantId, dao.MerchantAdmins.Table(), dao.MerchantAdmins.Columns().MerchantId)).
Fields(fmt.Sprintf("%s.*, %s.%s %s", dao.MerchantAdmins.Table(), dao.Stores.Table(), dao.Stores.Columns().Id, "storeId")).One()
one, err := dao.MerchantAdmins.Ctx(ctx).WherePri(in.MerchantAdminId).One()
if err != nil {
return nil, ecode.Fail.Sub("查询商户管理员失败")
}
@ -108,7 +104,6 @@ func (s *sMerchantAdmin) Info(ctx context.Context, in *model.MerchantAdminInfoIn
return &model.MerchantAdminInfoOut{
Username: admin.Username,
MerchantId: admin.MerchantId,
StoreId: one["storeId"].Int64(),
}, nil
}
func (s *sMerchantAdmin) Code(ctx context.Context, in *model.MerchantAdminCodeIn) (out *model.MerchantAdminCodeOut, err error) {