|
@@ -154,6 +154,22 @@ func AddSpecialRecord(user *models.WxUserItem, specialId, stopTime int) (err err
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ //专栏Pv数量进行加一
|
|
|
+ e = models.UpdateYanxuanSpecialHzPv(specialId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("UpdateYanxuanSpecialHzPv, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果没有阅读过,那么就给专栏文章的UV、作者的UV进行加一
|
|
|
+ if totalRecord == 0 {
|
|
|
+ e = models.UpdateYanxuanSpecialHzUv(specialId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("UpdateYanxuanSpecialHzUv, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -194,16 +210,24 @@ func GetYanxuanSpecialRecordByYanxuanSpecialId(articleIds []int) (mapResp map[in
|
|
|
}
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
- condition = ` AND yanxuan_special_id IN (` + utils.GetOrmInReplace(lenIds) + `) `
|
|
|
+ //condition = ` AND yanxuan_special_id IN (` + utils.GetOrmInReplace(lenIds) + `) `
|
|
|
+ //pars = append(pars, articleIds)
|
|
|
+ //listPv, e := models.GetCygxYanxuanSpecialRecordListPv(condition, pars)
|
|
|
+ //if e != nil {
|
|
|
+ // err = errors.New("GetCygxArticleHistoryRecordNewpvListPvCy, Err: " + e.Error())
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ condition += ` AND id IN (` + utils.GetOrmInReplace(lenIds) + `) `
|
|
|
pars = append(pars, articleIds)
|
|
|
- listPv, e := models.GetCygxYanxuanSpecialRecordListPv(condition, pars)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetCygxArticleHistoryRecordNewpvListPvCy, Err: " + e.Error())
|
|
|
+ listPv, e := models.GetYanxuanSpecialListBycondition(condition, pars, 0, lenIds)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetYanxuanSpecialListBycondition, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
mapResp = make(map[int]int, 0)
|
|
|
for _, v := range listPv {
|
|
|
- mapResp[v.YanxuanSpecialId] = v.Pv
|
|
|
+ mapResp[v.Id] = v.Pv + v.HzPv
|
|
|
}
|
|
|
return
|
|
|
}
|