MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / GetUserById

Function GetUserById

model/user.go:224–236  ·  view source on GitHub ↗
(id int, selectAll bool)

Source from the content-addressed store, hash-verified

222}
223
224func GetUserById(id int, selectAll bool) (*User, error) {
225 if id == 0 {
226 return nil, errors.New("id 为空!")
227 }
228 user := User{Id: id}
229 var err error = nil
230 if selectAll {
231 err = DB.First(&user, "id = ?", id).Error
232 } else {
233 err = DB.Omit("password").First(&user, "id = ?", id).Error
234 }
235 return &user, err
236}
237
238func GetUserIdByAffCode(affCode string) (int, error) {
239 if affCode == "" {

Callers 13

RequestPayMethod · 0.92
GetUserFunction · 0.92
GenerateAccessTokenFunction · 0.92
TransferAffQuotaFunction · 0.92
GetAffCodeFunction · 0.92
GetSelfFunction · 0.92
UpdateUserFunction · 0.92
checkUpdatePasswordFunction · 0.92
DeleteUserFunction · 0.92
DeleteSelfFunction · 0.92
UpdateUserSettingFunction · 0.92
GetUserCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected