From e332986e662dd6fa75ef0555ef3fcb4e4936ce43 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 22 Dec 2022 20:35:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=89=B9=E6=9D=83=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E8=8E=B7=E5=BE=97=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gourmet/api_createorder.go | 10 ++++++---- modules/smithy/api_createorder.go | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/gourmet/api_createorder.go b/modules/gourmet/api_createorder.go index 5ab87fd0f..97f126785 100644 --- a/modules/gourmet/api_createorder.go +++ b/modules/gourmet/api_createorder.go @@ -22,9 +22,10 @@ func (this *apiComp) CreateOrderCheck(session comm.IUserSession, req *pb.Gourmet ///美食城创建订单 func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreateOrderReq) (code pb.ErrorCode, data proto.Message) { var ( - res []*cfg.Gameatn // 订单消耗 - costTime int32 - szTime map[int32]int32 // 记录每个类型的订单耗时 key 是技能组type value 订单耗时 + res []*cfg.Gameatn // 订单消耗 + costTime int32 + szTime map[int32]int32 // 记录每个类型的订单耗时 key 是技能组type value 订单耗时 + privilegeAddItme int32 // 特权额外增加的时间 ) szTime = make(map[int32]int32, 0) code = this.CreateOrderCheck(session, req) @@ -70,8 +71,9 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat if cfgCom == nil { return } + privilegeAddItme = this.module.ModulePrivilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType8) _gourmet.OrderCostTime += costTime - if cfgCom.Gourmet < _gourmet.OrderCostTime { // 大于总时长是不允许的 + if cfgCom.Gourmet+privilegeAddItme < _gourmet.OrderCostTime { // 大于总时长是不允许的 code = pb.ErrorCode_GourmetMoreOrderTime return } diff --git a/modules/smithy/api_createorder.go b/modules/smithy/api_createorder.go index 26e4ab78d..eff21251b 100644 --- a/modules/smithy/api_createorder.go +++ b/modules/smithy/api_createorder.go @@ -21,8 +21,9 @@ func (this *apiComp) CreateOrderCheck(session comm.IUserSession, req *pb.SmithyC func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreateOrderReq) (code pb.ErrorCode, data proto.Message) { var ( - res []*cfg.Gameatn - costTime int32 + res []*cfg.Gameatn + costTime int32 + privilegeAddItme int32 // 特权额外增加的时间 ) code = this.CreateOrderCheck(session, req) @@ -83,7 +84,8 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate return } _smithy.OrderCostTime += costTime - if cfgCom.SmithyMaxtime < _smithy.OrderCostTime { // 大于总时长是不允许的 + privilegeAddItme = this.module.ModulePrivilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType10) + if cfgCom.SmithyMaxtime+privilegeAddItme < _smithy.OrderCostTime { // 大于总时长是不允许的 code = pb.ErrorCode_GourmetMoreOrderTime return } From 6a553f11e8323af317bdab963e47756f2e57694f Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 22 Dec 2022 23:56:40 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/sociaty/model_sociaty.go | 17 ++++++++++------- modules/task/model_active.go | 5 +++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/sociaty/model_sociaty.go b/modules/sociaty/model_sociaty.go index 4dc4b8323..d445f577e 100644 --- a/modules/sociaty/model_sociaty.go +++ b/modules/sociaty/model_sociaty.go @@ -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 Date: Fri, 23 Dec 2022 10:00:51 +0800 Subject: [PATCH 3/3] update --- modules/hunting/model_hunting.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/hunting/model_hunting.go b/modules/hunting/model_hunting.go index b25d35e93..f610a87ed 100644 --- a/modules/hunting/model_hunting.go +++ b/modules/hunting/model_hunting.go @@ -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 }