feat:完善入驻信息管理
This commit is contained in:
@ -10,6 +10,7 @@ import (
|
||||
"SciencesServer/utils"
|
||||
"errors"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Settled 入驻
|
||||
@ -76,7 +77,7 @@ func (c *Settled) filter(identity int, where ...*model2.ModelWhere) (bool, error
|
||||
return true, err
|
||||
}
|
||||
if count >= int64(mSysIdentity.RegisterCount) {
|
||||
return true, errors.New("操作错误,已超过当前身份最大注册人数")
|
||||
return true, errors.New("操作错误,已超过当前身份最大入驻人数")
|
||||
}
|
||||
return mSysIdentity.IsExamine == model2.SysIdentityExamineForYes, nil
|
||||
}
|
||||
@ -124,7 +125,14 @@ func (c *Settled) Company(params *SettledParams, inviterID uint64, other *config
|
||||
return err
|
||||
}
|
||||
}
|
||||
// 过滤用户其他公司入驻信息
|
||||
mUserCompany := model.NewUserCompany()
|
||||
|
||||
if err := model2.UpdatesWhere(mUserCompany.UserCompany, map[string]interface{}{
|
||||
"status": model2.InvalidStatusForYes, "updated_at": time.Now(),
|
||||
}, []*model2.ModelWhere{model2.NewWhere("uid", c.UID)}, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
mUserCompany.UID = c.UID
|
||||
mUserCompany.CompanyID = mManageCompany.ID
|
||||
return model2.Create(mUserCompany.UserCompany, tx)
|
||||
|
Reference in New Issue
Block a user