优化更新user表方法
This commit is contained in:
parent
dd2c22386c
commit
6b76d5dd41
@ -7,12 +7,6 @@
|
|||||||
<list default="true" id="853fcb60-a62b-4975-bc33-7fe9b5daba92" name="Changes" comment="">
|
<list default="true" id="853fcb60-a62b-4975-bc33-7fe9b5daba92" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/cmd/internal/dao/artistInfo.go" beforeDir="false" afterPath="$PROJECT_DIR$/cmd/internal/dao/artistInfo.go" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/cmd/internal/dao/artistInfo.go" beforeDir="false" afterPath="$PROJECT_DIR$/cmd/internal/dao/artistInfo.go" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/cmd/logs/artist_server.log" beforeDir="false" afterPath="$PROJECT_DIR$/cmd/logs/artist_server.log" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/cmd/model/invite.go" beforeDir="false" afterPath="$PROJECT_DIR$/cmd/model/invite.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/cmd/model/user.go" beforeDir="false" afterPath="$PROJECT_DIR$/cmd/model/user.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/pb/artistinfo/artistinfo.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pb/artistinfo/artistinfo.pb.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/pb/artistinfo/artistinfo.proto" beforeDir="false" afterPath="$PROJECT_DIR$/pb/artistinfo/artistinfo.proto" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/pkg/db/init.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/db/init.go" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -4,9 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gorm.io/plugin/soft_delete"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/alibaba/sentinel-golang/logging"
|
"github.com/alibaba/sentinel-golang/logging"
|
||||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
||||||
@ -489,6 +486,7 @@ func FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err er
|
|||||||
|
|
||||||
return rep, nil
|
return rep, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, err error) {
|
func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, err error) {
|
||||||
var preUpdateData model.User
|
var preUpdateData model.User
|
||||||
var tx = db.DB
|
var tx = db.DB
|
||||||
@ -551,31 +549,31 @@ func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, e
|
|||||||
if req.Envtype != "" {
|
if req.Envtype != "" {
|
||||||
preUpdateData.Envtype = req.Envtype
|
preUpdateData.Envtype = req.Envtype
|
||||||
}
|
}
|
||||||
var updateData = model.User{
|
//var updateData = model.User{
|
||||||
Model: model.Model{
|
// Model: model.Model{
|
||||||
ID: req.Id,
|
// ID: req.Id,
|
||||||
CreatedAt: time.Unix(req.CreatedAt, 0),
|
// CreatedAt: time.Unix(req.CreatedAt, 0),
|
||||||
UpdatedAt: time.Unix(req.UpdatedAt, 0),
|
// UpdatedAt: time.Unix(req.UpdatedAt, 0),
|
||||||
DeletedAt: soft_delete.DeletedAt(req.DeletedAt),
|
// DeletedAt: soft_delete.DeletedAt(req.DeletedAt),
|
||||||
},
|
// },
|
||||||
MgmtAccId: req.MgmtAccId,
|
// MgmtAccId: req.MgmtAccId,
|
||||||
MgmtArtistId: req.MgmtArtistId,
|
// MgmtArtistId: req.MgmtArtistId,
|
||||||
TelNum: req.TelNum,
|
// TelNum: req.TelNum,
|
||||||
InviteCode: req.InvitedCode,
|
// InviteCode: req.InvitedCode,
|
||||||
IsRealName: req.IsRealName,
|
// IsRealName: req.IsRealName,
|
||||||
RealNameId: req.RealNameId,
|
// RealNameId: req.RealNameId,
|
||||||
FddState: req.FddState,
|
// FddState: req.FddState,
|
||||||
CustomerId: req.CustomerId,
|
// CustomerId: req.CustomerId,
|
||||||
OpenId: req.OpenId,
|
// OpenId: req.OpenId,
|
||||||
IsRead: req.IsRead,
|
// IsRead: req.IsRead,
|
||||||
IsLock: req.IsLock,
|
// IsLock: req.IsLock,
|
||||||
Account: req.Account,
|
// Account: req.Account,
|
||||||
CertificateNum: req.CertificateNum,
|
// CertificateNum: req.CertificateNum,
|
||||||
CertificateImg: req.CertificateImg,
|
// CertificateImg: req.CertificateImg,
|
||||||
Photo: req.Photo,
|
// Photo: req.Photo,
|
||||||
Htmltype: req.Htmltype,
|
// Htmltype: req.Htmltype,
|
||||||
Envtype: req.Envtype,
|
// Envtype: req.Envtype,
|
||||||
}
|
//}
|
||||||
db.DB.Save(&updateData)
|
db.DB.Save(&preUpdateData)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user