|
@@ -277,7 +277,6 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
total = int64(length)
|
|
|
//全部,没有过滤条件 之前缓存500
|
|
|
} else if spqp.IsEmpty() && (spqp.PageNum-1)*spqp.PageSize < 200 && len(spqp.SelectInfoIds) == 0 && !spqp.Export { //全部,没有过滤条件 之前缓存5页*50条=250 非数据导出
|
|
|
- logx.Info("a2:", s.allKey(spqp.UserId))
|
|
|
allCache := &SubPush{}
|
|
|
var err error
|
|
|
if spqp.IsEnt == false {
|
|
@@ -308,7 +307,6 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
}
|
|
|
total = allCache.Count
|
|
|
} else {
|
|
|
- logx.Info("a4")
|
|
|
result, total = s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
|
|
|
}
|
|
|
if result == nil {
|
|
@@ -349,7 +347,6 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
return result, count
|
|
|
}
|
|
|
//时间
|
|
|
- logx.Info("starttime,endtime", starttime, endtime)
|
|
|
if starttime > 0 && endtime > 0 {
|
|
|
userStr += fmt.Sprintf(" and a.date>=%d and date<=%d", starttime, endtime)
|
|
|
} else if starttime > 0 && endtime == 0 {
|
|
@@ -498,7 +495,6 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
if isLimit {
|
|
|
findSql += fmt.Sprintf(" limit %d,%d", (spqp.PageNum-1)*size, size)
|
|
|
}
|
|
|
- logx.Info("findSql", findSql)
|
|
|
logx.Info(spqp.NewUserId, "subscribePush query sql:", findSql)
|
|
|
list := spqp.BaseServiceMysql.SelectBySql(findSql)
|
|
|
if list != nil && len(*list) > 0 {
|
|
@@ -634,7 +630,6 @@ func (s *subscribePush) GetJyPushs(datas []map[string]interface{}) (pushCas []*P
|
|
|
|
|
|
// 查看全部列表缓存
|
|
|
func (s *subscribePush) PutAllCache(userId string, datas *SubPush) {
|
|
|
- log.Println(s.allKey(userId), datas, oneDay)
|
|
|
redis.Put("pushcache_2_a", s.allKey(userId), datas, oneDay)
|
|
|
}
|
|
|
|
|
@@ -858,8 +853,7 @@ func (s *subscribePush) DefaultDatas(spqp *SubPushQueryParam) (hasNextPage bool,
|
|
|
return false, 0, nil
|
|
|
}
|
|
|
t1 := time.Now()
|
|
|
- log.Println("userId:", spqp.UserId)
|
|
|
- log.Println("newUserId:", spqp.NewUserId)
|
|
|
+ log.Println("userId:", spqp.UserId, "newUserId:", spqp.NewUserId)
|
|
|
//用户信息
|
|
|
bsp := s.getUserInfo(spqp)
|
|
|
logx.Info("获取用户信息耗时:", time.Since(t1))
|
|
@@ -1367,7 +1361,6 @@ func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.Println(keyData)
|
|
|
if (spqp.VipPower == 1 || spqp.MemberPower == 1) || (spqp.UserPower == 1 && spqp.PowerSource == 0) {
|
|
|
//1、mysql entniche_user_rule表中获取自己的分发规则id
|
|
|
data := IC.MainMysql.SelectBySql(`select rule_id from entniche_user_rule where user_id =? and dept_id =?`, spqp.EntUserId, spqp.DeptId)
|
|
@@ -1457,7 +1450,6 @@ func KeyHandle(a_items map[string]interface{}) []interface{} {
|
|
|
func MapToarr(data map[string][]interface{}, userType string) []*bxsubscribe.KeyItems {
|
|
|
result := []*bxsubscribe.KeyItems{}
|
|
|
for k, v := range data {
|
|
|
- log.Println(common.ObjArrToStringArr(v))
|
|
|
keyArr := []*bxsubscribe.Key{}
|
|
|
for _, m := range common.ObjArrToMapArr(v) {
|
|
|
keys := &bxsubscribe.Key{}
|