|
@@ -152,3 +152,83 @@ func initFansNum() {
|
|
|
UdpateYanxuanSpecialFansNum(v.UserId)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 专栏Pv
|
|
|
+func initPv() {
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ list, tmpErr := models.GetYanxuanSpecialList(0, condition, pars, 0, 99999)
|
|
|
+
|
|
|
+ fmt.Println(len(list))
|
|
|
+ fmt.Println(tmpErr)
|
|
|
+
|
|
|
+ for _, v := range list {
|
|
|
+ condition = ""
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = " AND company_id != 16 AND user_id > 0 AND yanxuan_special_id = ? "
|
|
|
+ pars = append(pars, v.Id)
|
|
|
+ totalYanxuanSpecial, err := models.GetCygxYanxuanSpecialRecordCount(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ totalYanxuanSpecialUv, err := models.GetCygxYanxuanSpecialRecordCountGroup(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ fmt.Println(totalYanxuanSpecial, "____", totalYanxuanSpecialUv)
|
|
|
+ err = models.UpdateYanxuanSpecialPvNUm(totalYanxuanSpecial, v.Id)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = models.UpdateYanxuanSpecialUvUm(totalYanxuanSpecialUv, v.Id)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 作者Pv
|
|
|
+func inituser() {
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ list, tmpErr := models.GetYanxuanSpecialAuthorList(condition, pars, 0, 9999)
|
|
|
+
|
|
|
+ fmt.Println(len(list))
|
|
|
+ fmt.Println(tmpErr)
|
|
|
+
|
|
|
+ for _, v := range list {
|
|
|
+ condition = ""
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = " AND company_id != 16 AND user_id > 0 AND yanxuan_special_id IN ( SELECT id FROM cygx_yanxuan_special WHERE user_id = ? ) "
|
|
|
+ pars = append(pars, v.UserId)
|
|
|
+ totalYanxuanSpecial, err := models.GetCygxYanxuanSpecialRecordCount(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ totalYanxuanSpecialUv, err := models.GetCygxYanxuanSpecialRecordCountGroup(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ fmt.Println(totalYanxuanSpecial, "____", totalYanxuanSpecialUv)
|
|
|
+ err = models.UpdateYanxuanSpecialauthorPvNUm(totalYanxuanSpecial, v.UserId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = models.UpdateYanxuanSpecialauthorUvUm(totalYanxuanSpecialUv, v.UserId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|