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

View File

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

View File

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