|
@@ -617,3 +617,52 @@ func GetYanxuanSpecialLikeCountDifferent(cont context.Context) (err error) {
|
|
|
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+//func init() {
|
|
|
+// need_1006INIT()
|
|
|
+//}
|
|
|
+
|
|
|
+// 获取专栏用户最新的一篇文章信息
|
|
|
+func need_1006INIT() (mapResp map[int]*models.CygxYanxuanSpecialCenterAuthorResp) {
|
|
|
+
|
|
|
+ var err error
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ go utils.SendAlarmMsg(fmt.Sprint("获取研选专栏用户信息失败,GetBestNewYanxuanSpecialByUserId Err ", err, "userIds"), 2)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ list, e := models.GetYanxuanSpecialListBycondition(condition, pars, 0, 999)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetYanxuanSpecialListBycondition, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapResp = make(map[int]*models.CygxYanxuanSpecialCenterAuthorResp, 0)
|
|
|
+ for _, v := range list {
|
|
|
+ fmt.Println(v.Id)
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = " AND yanxuan_special_id = ? AND company_id = 16 "
|
|
|
+ pars = append(pars, v.Id)
|
|
|
+ listYanxuanSpecialRecord, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition, pars)
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ listYanxuanSpecialRecordUv, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition+" GROUP BY user_id ", pars)
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ e = models.Need_1006INIT(len(listYanxuanSpecialRecord), len(listYanxuanSpecialRecordUv), v.Id)
|
|
|
+
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|