35 lines
737 B
35 lines
737 B
2 months ago
|
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
|
||
|
}
|