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

Function inviteUser

model/user.go:263–272  ·  view source on GitHub ↗
(inviterId int)

Source from the content-addressed store, hash-verified

261}
262
263func inviteUser(inviterId int) (err error) {
264 user, err := GetUserById(inviterId, true)
265 if err != nil {
266 return err
267 }
268 user.AffCount++
269 user.AffQuota += common.QuotaForInviter
270 user.AffHistoryQuota += common.QuotaForInviter
271 return DB.Save(user).Error
272}
273
274func (user *User) TransferAffQuotaToQuota(quota int) error {
275 // 检查quota是否小于最小额度

Callers 1

InsertMethod · 0.85

Calls 2

GetUserByIdFunction · 0.85
SaveMethod · 0.80

Tested by

no test coverage detected