This commit is contained in:
meixiongfeng 2023-06-26 11:42:31 +08:00
commit f64144f8f3
3 changed files with 33 additions and 19 deletions

View File

@ -1727,8 +1727,13 @@
}, },
"main": [ "main": [
{ {
<<<<<<< HEAD
"key": 2, "key": 2,
"param": 1100208 "param": 1100208
=======
"key": 1,
"param": 1
>>>>>>> a3bec23bf241b6dd679796965c80c09d855ce741
} }
], ],
"wkqbx": 0, "wkqbx": 0,
@ -1750,8 +1755,13 @@
}, },
"main": [ "main": [
{ {
<<<<<<< HEAD
"key": 2, "key": 2,
"param": 1100504 "param": 1100504
=======
"key": 1,
"param": 1
>>>>>>> a3bec23bf241b6dd679796965c80c09d855ce741
} }
], ],
"wkqbx": 0, "wkqbx": 0,
@ -1773,8 +1783,13 @@
}, },
"main": [ "main": [
{ {
<<<<<<< HEAD
"key": 2, "key": 2,
"param": 1100504 "param": 1100504
=======
"key": 1,
"param": 1
>>>>>>> a3bec23bf241b6dd679796965c80c09d855ce741
} }
], ],
"wkqbx": 0, "wkqbx": 0,
@ -1796,8 +1811,13 @@
}, },
"main": [ "main": [
{ {
<<<<<<< HEAD
"key": 2, "key": 2,
"param": 1100604 "param": 1100604
=======
"key": 1,
"param": 1
>>>>>>> a3bec23bf241b6dd679796965c80c09d855ce741
} }
], ],
"wkqbx": 0, "wkqbx": 0,
@ -1819,8 +1839,13 @@
}, },
"main": [ "main": [
{ {
<<<<<<< HEAD
"key": 2, "key": 2,
"param": 1100608 "param": 1100608
=======
"key": 1,
"param": 1
>>>>>>> a3bec23bf241b6dd679796965c80c09d855ce741
} }
], ],
"wkqbx": 0, "wkqbx": 0,

View File

@ -5,40 +5,29 @@ import (
"go_dreamfactory/lego/sys/mgo" "go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/sys/db"
"math/rand" "math/rand"
"time"
) )
//参数校验 // 参数校验
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.ArenaInfoReq) (errdata *pb.ErrorData) { func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.ArenaInfoReq) (errdata *pb.ErrorData) {
return return
} }
///获取自己的排行榜信息 // /获取自己的排行榜信息
func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (errdata *pb.ErrorData) { func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (errdata *pb.ErrorData) {
var ( var (
global *cfg.GameGlobalData global *cfg.GameGlobalData
info *pb.DBArenaUser info *pb.DBArenaUser
user *pb.DBUser user *pb.DBUser
model *db.DBModel
err error err error
) )
if errdata = this.InfoCheck(session, req); errdata != nil { if errdata = this.InfoCheck(session, req); errdata != nil {
return return
} }
if model, err = this.module.GetDBNodule(session, comm.TableUser, time.Hour); err != nil { user = this.module.ModuleUser.GetUser(session.GetUserId())
errdata = &pb.ErrorData{ if user == nil {
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
user = &pb.DBUser{}
if err = model.Get(session.GetUserId(), user); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), Title: pb.ErrorCode_DBError.ToString(),

View File

@ -9,7 +9,7 @@ import (
"time" "time"
) )
//参数校验 // 参数校验
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) { func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) {
if req.SType == 0 { if req.SType == 0 {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -20,7 +20,7 @@ func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.ShopGetList
return return
} }
///获取用户商品列表 // /获取用户商品列表
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) { func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) {
var ( var (
err error err error
@ -109,7 +109,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
leftrefnum = shopconf.Rnum leftrefnum = shopconf.Rnum
} }
tdata = time.Since(time.Unix(sdata.LastRefreshTime, 0)) tdata = configure.Now().Sub((time.Unix(sdata.LastRefreshTime, 0)))
switch shopconf.Rtype { switch shopconf.Rtype {
case 1: case 1:
ltime = time.Hour * time.Duration(shopconf.Rtime) ltime = time.Hour * time.Duration(shopconf.Rtime)
@ -125,7 +125,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
break break
} }
if req.IsManualRefresh && shopconf.Rtype == 1 { //可以手动刷新 if req.IsManualRefresh && shopconf.Rnum > 0 { //可以手动刷新
isrefresh := false isrefresh := false
refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2)) refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
if refresh > 0 { // if refresh > 0 { //