Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into meixiongfeng

This commit is contained in:
meixiongfeng 2022-12-23 10:23:38 +08:00
commit b3e5c7c2c7
3 changed files with 14 additions and 11 deletions

View File

@ -3,7 +3,6 @@ package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
@ -34,7 +33,7 @@ func (this *modelHunting) modifyHuntingDataByObjId(uid string, data map[string]i
// 获取列表信息
func (this *modelHunting) getHuntingList(uid string) (result *pb.DBHunting, err error) {
result = &pb.DBHunting{}
if err = this.Get(uid, result); err != nil && mgo.MongodbNil != err {
if err = this.Get(uid, result); err != nil {
return
}

View File

@ -352,9 +352,10 @@ func (this *ModelSociaty) updateSociaty(sociatyId string, update map[string]inte
// 退出公会
func (this *ModelSociaty) quit(uid string, sociaty *pb.DBSociaty) error {
for i, m := range sociaty.Members {
if m.Uid == uid {
for i:=0;i<len(sociaty.Members);i++{
if sociaty.Members[i].Uid == uid {
sociaty.Members = append(sociaty.Members[:i], sociaty.Members[i+1:]...)
i--
}
}
update := map[string]interface{}{
@ -385,9 +386,10 @@ func (this *ModelSociaty) dismiss(sociaty *pb.DBSociaty) error {
//删除请求记录
func (this *ModelSociaty) delFromApplyRecord(uid string, sociaty *pb.DBSociaty) error {
for i, ar := range sociaty.ApplyRecord {
if ar.Uid == uid {
for i:=0;i<len(sociaty.ApplyRecord);i++{
if sociaty.ApplyRecord[i].Uid == uid {
sociaty.ApplyRecord = append(sociaty.ApplyRecord[:i], sociaty.ApplyRecord[i+1:]...)
i--
}
}
update := map[string]interface{}{
@ -511,12 +513,13 @@ func (this *ModelSociaty) assign(srcId, targetId string, sociaty *pb.DBSociaty)
// targetId 踢出目标
// 不允许踢出会长
func (this *ModelSociaty) discharge(targetId string, sociaty *pb.DBSociaty) error {
for i, m := range sociaty.Members {
if m.Uid == targetId {
if m.Job == pb.SociatyJob_PRESIDENT {
for i:=0;i<len(sociaty.Members);i++ {
if sociaty.Members[i].Uid == targetId {
if sociaty.Members[i].Job == pb.SociatyJob_PRESIDENT {
return comm.NewCustomError(pb.ErrorCode_SociatyMasterNoDiss)
}
sociaty.Members = append(sociaty.Members[:i], sociaty.Members[i+1:]...)
i--
}
}
update := map[string]interface{}{

View File

@ -130,9 +130,10 @@ func (this *ModelTaskActive) clearTask(uid string, taskTag ...comm.TaskTag) {
return
}
data := this.getActiveListByTag(uid, taskTag[0])
for i, v := range data {
if v.Tag == int32(taskTag[0]) {
for i:=0; i<len(data); i++ {
if data[i].Tag == int32(taskTag[0]) {
data = append(data[:i], data[i+1:]...)
i--
}
}
update := map[string]interface{}{