兑换记录修改

This commit is contained in:
by 2024-09-25 17:38:13 +08:00
parent eb32e72916
commit ef8cbfaedd
1 changed files with 38 additions and 5 deletions

View File

@ -3,6 +3,9 @@ package main
import ( import (
"fmt" "fmt"
"math/rand" "math/rand"
"mongo.games.com/game/proto"
webapi_proto "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/webapi"
"strconv" "strconv"
"time" "time"
@ -665,12 +668,42 @@ func CSDollChangeLog(s *netlib.Session, packetid int, data interface{}, sid int6
pack.Info = append(pack.Info, info) pack.Info = append(pack.Info, info)
} }
} }
value := ShopMgrSington.GetDollExchangeRecord(p) task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
if value != nil && value.Info != nil { msg := &webapi_proto.ASGetDollExchangeOrder{
pack.Info = append(pack.Info, value.Info...) Snid: p.SnId,
Platform: p.Platform,
}
buff, err := webapi.API_DollExchangeRecord(common.GetAppId(), msg)
as := &webapi_proto.SAGetDollExchangeOrder{}
if err != nil {
logger.Logger.Error("API_DollExchangeRecord error:", err)
return nil
} else if err := proto.Unmarshal(buff, as); err != nil { // 有订单
logger.Logger.Errorf("DollExchangeRecord: %v", err)
return nil
}
return as
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
if data != nil {
if as := data.(*webapi_proto.SAGetDollExchangeOrder); as != nil {
for _, v := range as.OrderList {
cdata := ShopMgrSington.GetExchangeData(p.Platform, v.GoodsId)
record := &bag.DillChangeLogInfo{
CreateTs: strconv.FormatInt(v.CreateTime, 10),
State: v.Status,
Remark: v.Remark,
ItemId: cdata.ItemId,
ItemNum: v.ExchangeNum,
TypeId: 2,
}
pack.Info = append(pack.Info, record)
}
}
} }
p.SendToClient(int(bag.SPacketID_PACKET_SC_DollChangeLog), pack) p.SendToClient(int(bag.SPacketID_PACKET_SC_DollChangeLog), pack)
}), "DollExchangeRecord").Start()
}), "CSDollChangeLog").Start() }), "CSDollChangeLog").Start()
return nil return nil
} }