兑换记录修改
This commit is contained in:
parent
eb32e72916
commit
ef8cbfaedd
|
@ -3,6 +3,9 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"mongo.games.com/game/proto"
|
||||
webapi_proto "mongo.games.com/game/protocol/webapi"
|
||||
"mongo.games.com/game/webapi"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -665,12 +668,42 @@ func CSDollChangeLog(s *netlib.Session, packetid int, data interface{}, sid int6
|
|||
pack.Info = append(pack.Info, info)
|
||||
}
|
||||
}
|
||||
value := ShopMgrSington.GetDollExchangeRecord(p)
|
||||
if value != nil && value.Info != nil {
|
||||
pack.Info = append(pack.Info, value.Info...)
|
||||
}
|
||||
p.SendToClient(int(bag.SPacketID_PACKET_SC_DollChangeLog), pack)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
msg := &webapi_proto.ASGetDollExchangeOrder{
|
||||
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)
|
||||
}), "DollExchangeRecord").Start()
|
||||
}), "CSDollChangeLog").Start()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue