|
|
@@ -8,6 +8,7 @@ import (
|
|
|
"mtp2_if/rediscli"
|
|
|
"mtp2_if/utils"
|
|
|
"sort"
|
|
|
+ "strconv"
|
|
|
"time"
|
|
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
|
@@ -140,9 +141,15 @@ func (s RedisTradeHolderDetailExArray) Swap(i, j int) { s[i], s[j] = s[j], s[i]
|
|
|
// GetDataEx 从数据库中查询数据
|
|
|
func (r *RedisTradeHolderDetailEx) GetDataEx(userId int, goodsId int) (sData RedisTradeHolderDetailExArray, err error) {
|
|
|
redisCli := rediscli.GetRedisClient()
|
|
|
+ g := strconv.Itoa(goodsId)
|
|
|
+ if goodsId == 0 {
|
|
|
+ g = "*"
|
|
|
+ }
|
|
|
|
|
|
sData = make([]RedisTradeHolderDetailEx, 0)
|
|
|
- key := fmt.Sprintf("TradeHolderDetailEx:%d:*:%d:*", goodsId, userId)
|
|
|
+ // boost::format fmtDuration("TradeHolderDetailEx:%d_%d_%d_%" PRId64 "");
|
|
|
+ // fmtDuration % detailEx.goodsid() % detailEx.buyorsell()%detailEx.userid()%detailEx.tradeid();
|
|
|
+ key := fmt.Sprintf("TradeHolderDetailEx:%s:*:%d:*", g, userId)
|
|
|
if ret, err := redisCli.Do("keys", key).Result(); err == nil {
|
|
|
datas := ret.([]interface{})
|
|
|
for _, item := range datas {
|