Browse Source

fix:bug

token_replace
Tooooommy 4 years ago
parent
commit
33b5eb548a
  1. 12
      controllers/client/login.go
  2. 4
      models/module_service_history.go

12
controllers/client/login.go

@ -118,6 +118,18 @@ func (t *UserCtl) WxLogin() {
}
t.CheckErr(err)
// 校验邀请函是否开启
invitation := new(models.Invitation)
exist, err = invitation.GetInvitationByActivityId(activityId)
t.CheckErr(err)
//t.Assert(exist, code.MSG_INVITE_SETTING_NOT_EXIST, "邀请函设置不存在")
if exist { // 存在邀请函
letter := new(models.InvitationLetter)
exist, err = letter.GetByUserIdAndActivityId(user.Id, activity.Id, activity.ArchId, activity.RehearsalId)
t.CheckErr(err)
t.Assert(exist, code.MSG_INVITE_LETTER_NOT_EXIST, "您尚未接受过邀请")
}
sign := new(models.SignUp)
exist, err = sign.GetByActivityId(activityId)
t.CheckErr(err)

4
models/module_service_history.go

@ -33,8 +33,8 @@ func (t *ModuleServiceHistory) GetByModuleIdAndName(id int, name string) (bool,
return core.GetXormAuto().Where("is_delete=0 and service_module_id=? and name=?", id, name).Get(t)
}
func (t *ModuleServiceHistory) ExistSignModule(ids []interface{}) (bool, error) {
return core.GetXormAuto().Where("is_delete=0 and name=?", "签到").In("id", ids...).Exist(t)
func (t *ModuleServiceHistory) ExistSignModule(ids interface{}) (bool, error) {
return core.GetXormAuto().Where("is_delete=0 and name=?", "签到").In("id", ids).Exist(t)
}
func GetModuleServiceHistoryIdsByIdAndName(serviceId, serviceName interface{}) ([]int, error) {

Loading…
Cancel
Save