游戏搜索功能

pull/1/head
mofangmin 1 year ago
parent a5eac5f7cb
commit 755c3dd43b
  1. 9
      call/config.go
  2. 4
      modules/pay/gopay/base.go
  3. 4
      modules/pay/grepay/base.go
  4. 4
      modules/pay/mlpay/base.go
  5. 37
      modules/web/handler/game.go

@ -9,6 +9,7 @@ import (
"server/db" "server/db"
"server/util" "server/util"
"sort" "sort"
"strings"
"time" "time"
"github.com/liangdas/mqant/log" "github.com/liangdas/mqant/log"
@ -721,6 +722,14 @@ func GetConfigGameListByID(provider, gameID int) *common.ConfigGameList {
return nil return nil
} }
func GetConfigGameListByName(name string) (ret []*common.ConfigGameList) {
for _, v := range configGameList {
if strings.Index(v.Name, name) != -1 {
ret = append(ret, v)
}
}
return
}
func GetConfigGameListByType(t int) []*common.ConfigGameList { func GetConfigGameListByType(t int) []*common.ConfigGameList {
ret := []*common.ConfigGameList{} ret := []*common.ConfigGameList{}
for _, v := range configGameList { for _, v := range configGameList {

@ -73,7 +73,7 @@ func (s *Sub) GetResp() (proto.Message, error) {
func (s *Sub) PackPayReq() interface{} { func (s *Sub) PackPayReq() interface{} {
r := s.Base.PayReq r := s.Base.PayReq
send := &PayReq{ send := &PayReq{
Amount: r.Amount * 100, Amount: r.Amount / 100,
Currency: "INR", Currency: "INR",
MerID: mid, MerID: mid,
NotifyURL: values.GetPayCallback(values.GoPay), NotifyURL: values.GetPayCallback(values.GoPay),
@ -94,7 +94,7 @@ func (s *Sub) PackWithdrawReq() interface{} {
return nil return nil
} }
send := &WithdrawReq{ send := &WithdrawReq{
Amount: r.Amount * 100, Amount: r.Amount / 100,
Currency: "INR", Currency: "INR",
MerID: mid, MerID: mid,
NotifyURL: values.GetWithdrawCallback(values.GoPay), NotifyURL: values.GetWithdrawCallback(values.GoPay),

@ -96,7 +96,7 @@ func (s *Sub) PackPayReq() interface{} {
CustOrderNo: r.OrderID, CustOrderNo: r.OrderID,
TranType: tranType, TranType: tranType,
ClearType: "01", ClearType: "01",
PayAmt: r.Amount * 100, PayAmt: r.Amount / 100,
BackUrl: values.GetPayCallback(values.GrePay), BackUrl: values.GetPayCallback(values.GrePay),
FrontUrl: values.GetFrontCallback(), FrontUrl: values.GetFrontCallback(),
GoodsName: "shopbuy", GoodsName: "shopbuy",
@ -123,7 +123,7 @@ func (s *Sub) PackWithdrawReq() interface{} {
CasType: "00", CasType: "00",
Country: "IN", Country: "IN",
Currency: "INR", Currency: "INR",
CasAmt: r.Amount * 100, CasAmt: r.Amount / 100,
DeductWay: "02", DeductWay: "02",
CallBackUrl: values.GetWithdrawCallback(values.GrePay), CallBackUrl: values.GetWithdrawCallback(values.GrePay),
Account: config.GetConfig().Pay.GrePay.WithdrawAccount, Account: config.GetConfig().Pay.GrePay.WithdrawAccount,

@ -94,7 +94,7 @@ func (s *Sub) PackPayReq() interface{} {
ApplicationID: ApplicationId, ApplicationID: ApplicationId,
PayWay: 2, PayWay: 2,
PartnerOrderNo: r.OrderID, PartnerOrderNo: r.OrderID,
Amount: r.Amount * 100, Amount: r.Amount / 100,
Currency: "INR", Currency: "INR",
Name: r.Name, Name: r.Name,
GameId: int(r.UID), GameId: int(r.UID),
@ -115,7 +115,7 @@ func (s *Sub) PackWithdrawReq() interface{} {
send := &WithdrawReq{ send := &WithdrawReq{
PartnerID: PartnerId, PartnerID: PartnerId,
PartnerWithdrawNo: r.OrderID, PartnerWithdrawNo: r.OrderID,
Amount: r.Amount * 100, Amount: r.Amount / 100,
Currency: "INR", Currency: "INR",
GameId: fmt.Sprintf("%d", r.UID), GameId: fmt.Sprintf("%d", r.UID),
NotifyURL: values.GetWithdrawCallback(values.MLPay), NotifyURL: values.GetWithdrawCallback(values.MLPay),

@ -231,31 +231,14 @@ func GameSearch(c *gin.Context) {
} }
resp := &values.GameSearchResp{} resp := &values.GameSearchResp{}
a.Data = resp a.Data = resp
// var list, tmp []*common.ConfigGameList list := call.GetConfigGameListByName(req.Name)
// tmp = call.GetConfigGameList(0, req.Name) start := req.Page * req.Num
// end := (req.Page + 1) * req.Num
// if len(req.Name) > 0 { if start > len(list)-1 {
// reqName := strings.ToLower(req.Name) return
// for _, v := range tmp { }
// if strings.Contains(strings.ToLower(v.Name), reqName) { if end > len(list) {
// list = append(list, v) end = len(list)
// } }
// } resp.List = list[start:end]
// } else {
// list = tmp
// }
//
// start := req.Page * req.Num
// end := (req.Page + 1) * req.Num
//
// if start > len(list)-1 {
// return
// }
// if end > len(list) {
// end = len(list)
// }
// resp.List = list[start:end]
// for _, v := range resp.List {
// v.Jackpot = call.GetJackpot(common.JackpotTypeGame, v.GameID)
// }
} }

Loading…
Cancel
Save