Browse Source

统计分享修改

wangkaiyue 4 years ago
parent
commit
f84eaed694
1 changed files with 3 additions and 1 deletions
  1. 3 1
      jydocs-back/public/db.go

+ 3 - 1
jydocs-back/public/db.go

@@ -103,7 +103,9 @@ func OpenShareJydoc(fromId, openId, docId string) {
 	}) == 0 {
 		return
 	}
-	if redis.Get("other", fmt.Sprintf("integral_article_%s_%s", fromId, docId)) == nil {
+	key := fmt.Sprintf("integral_article_%s_%s_%s", docId, fromId, openId)
+	if redis.Incr("other", key) == 1 {
+		_ = redis.SetExpire("other", key, 24*60*60)
 		pushErr := func() error {
 			b, _ := json.Marshal(&model.Message{
 				E_code:   "jydocs_doc_open",