You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
737 B

package data
import (
"context"
"matchmaking-system/internal/pkg/flags"
"matchmaking-system/internal/pkg/logging/applogger"
models "matchmaking-system/internal/pkg/model"
"time"
)
// UpdateBotUsersByIsReal
//
// @Description: 更新模拟账户KYC认证
// @receiver uo
// @param ctx
// @param userId
// @return error
func (uo *userOrderRepo) UpdateBotUsersByIsReal(ctx context.Context, userId int64) error {
stock := models.BotUsers{
UpdateTime: time.Now(),
IsReal: 1,
}
checkNum, err := uo.data.mysqlDB.Table(flags.BotUsers).
Where("user_id = ?", userId).
Where("is_test_user = 2").
Update(&stock)
if err != nil || checkNum < 0 {
applogger.Error("更新数据失败:%v", err)
return err
}
return err
}