|
@@ -61,13 +61,34 @@ func AddCygxUserAdminShareHistory(user *models.WxUserItem, source, sourceTitle,
|
|
|
if user.UserId == 0 {
|
|
|
return
|
|
|
}
|
|
|
+ var err error
|
|
|
+ //如果是已经上传了音视的活动不记录
|
|
|
+ if source == utils.CYGX_OBJ_ACTIVITY {
|
|
|
+ totalvi, e := models.GetCygxActivityVideoCount(sourceId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxActivityVideoCount, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if totalvi > 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ totalvo, e := models.GetCygxActivityVoiceCount(sourceId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxActivityVoiceCount, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if totalvo > 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//3秒之内多次请求,不重复记录
|
|
|
key := "CYGX_" + source + "_" + strconv.Itoa(sourceId) + "_" + strconv.Itoa(user.UserId)
|
|
|
if utils.Rc.IsExist(key) {
|
|
|
return
|
|
|
}
|
|
|
utils.Rc.Put(key, 1, 3*time.Second)
|
|
|
- var err error
|
|
|
+
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|