修复报错

This commit is contained in:
徐俊杰 2023-03-21 15:54:03 +08:00
parent 18d52d40a6
commit 7adf2cb8ba
3 changed files with 41 additions and 41 deletions

View File

@ -24,20 +24,20 @@ import (
func RegisterUser(req *artistInfoUser.RegisterUserRequest) (rep *artistInfoUser.RegisterUserRespond, err error) {
var user = model.User{
MgmtAccId: req.MgmtAccId,
TelNum: req.TelNum,
MgmtArtistId: req.MgmtArtistId,
MgmtArtistUid: req.MgmtArtistUid,
InviteCode: req.UserInviteCode,
Account: req.Account,
}
zap.L().Debug(fmt.Sprintf("RegisterUser--user: %+v", user))
if err = db.DB.Create(&user).Error; err != nil {
zap.L().Error("register user err", zap.Error(err))
err = errors.New(m.ERROR_SELECT)
return nil, err
}
// var user = model.User{
// MgmtAccId: req.MgmtAccId,
// TelNum: req.TelNum,
// MgmtArtistId: req.MgmtArtistId,
// MgmtArtistUid: req.MgmtArtistUid,
// InviteCode: req.UserInviteCode,
// Account: req.Account,
// }
// zap.L().Debug(fmt.Sprintf("RegisterUser--user: %+v", user))
// if err = db.DB.Create(&user).Error; err != nil {
// zap.L().Error("register user err", zap.Error(err))
// err = errors.New(m.ERROR_SELECT)
// return nil, err
// }
return
}
@ -764,9 +764,9 @@ func UpdateUserData(req *artistInfoUser.UserInfo) (rep *artistInfoUser.CommonNoP
if req.RealName.IdNum != "" {
realName.IdNum = req.RealName.IdNum
}
if req.RealName.TelNum != "" {
realName.TelNum = req.RealName.TelNum
}
// if req.RealName.TelNum != "" {
// realName.TelNum = req.RealName.TelNum
// }
if req.RealName.IdCardFront != "" {
realName.IdCardFront = req.RealName.IdCardFront
}

View File

@ -1,32 +1,32 @@
package dao
import (
"github.com/fonchain/fonchain-artistinfo/cmd/model"
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
"gorm.io/gorm/clause"
)
// import (
// "github.com/fonchain/fonchain-artistinfo/cmd/model"
// "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
// db "github.com/fonchain/fonchain-artistinfo/pkg/db"
// "gorm.io/gorm/clause"
// )
// =====================================
//
// 对账单批次
func CreateStatementBatch(in *artistinfoStatement.StatementBatchRequest) (res model.StatementBatch, err error) {
res = model.StatementBatch{
StType: in.StType,
ArtistUid: in.ArtistUid,
ArtistRealName: in.ArtistRealName,
FlowStatus: in.FlowStatus,
BatchTime: in.BatchTime,
MinPrice: in.MinPrice,
GuaranteePrice: in.GuaranteePrice,
FileUrl: in.FileUrl,
}
err = db.DB.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "st_type"}, {Name: "artist_uid"}, {Name: "batch_time"}},
UpdateAll: true,
}).Create(&res).Error
return
}
// func CreateStatementBatch(in *artistinfoStatement.StatementBatchRequest) (res model.StatementBatch, err error) {
// res = model.StatementBatch{
// StType: in.StType,
// ArtistUid: in.ArtistUid,
// ArtistRealName: in.ArtistRealName,
// FlowStatus: in.FlowStatus,
// BatchTime: in.BatchTime,
// MinPrice: in.MinPrice,
// GuaranteePrice: in.GuaranteePrice,
// FileUrl: in.FileUrl,
// }
// err = db.DB.Clauses(clause.OnConflict{
// Columns: []clause.Column{{Name: "st_type"}, {Name: "artist_uid"}, {Name: "batch_time"}},
// UpdateAll: true,
// }).Create(&res).Error
// return
// }
// func BatchCreateStatementBatch(in *artistinfoStatement.BatchCreateStatementBatchRequest) error {
// var datas = []model.StatementBatch{}

View File

@ -30,7 +30,7 @@ func getColumnIndex(num int) string {
return column
}
func Int[T int | int | uint8 | uint32 | uint64 | int32 | int64](value string) T {
func Int[T int | uint | uint8 | uint32 | uint64 | int32 | int64](value string) T {
v, _ := strconv.Atoi(value)
return T(v)
}