xuzhiheng 4 vuotta sitten
vanhempi
commit
1d9b66bd95
2 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 1 1
      services/stdlib/docActivity.go
  2. 2 2
      services/stdlib/docGet.go

+ 1 - 1
services/stdlib/docActivity.go

@@ -20,7 +20,7 @@ func DocActivityList(pageSize, pageNum, activityId int, appId, userId string) *s
 	for _, v := range docActivity {
 		var buyCount int64
 		isbuy := false
-		jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ? and category = 1", v.DocId, userId, appId).Count(&buyCount)
+		jyDocsRpcUtil.GetJyDocsDB().Table("user_doc").Where("docId = ? and userId = ? and appId = ? and isDownload = 1", v.DocId, userId, appId).Count(&buyCount)
 		if buyCount > 0 {
 			isbuy = true
 		}

+ 2 - 2
services/stdlib/docGet.go

@@ -14,11 +14,11 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 	var buyCount int64
 	var collectCount int64
 	isbuy, isCollect := false, false
-	jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ? and category = 1", docId, userId, appId).Count(&buyCount)
+	jyDocsRpcUtil.GetJyDocsDB().Table("user_doc").Where("docId = ? and userId = ? and appId = ? and isDownload = 1", docId, userId, appId).Count(&buyCount)
 	if buyCount > 0 {
 		isbuy = true
 	}
-	jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ? and category = 2", docId, userId, appId).Count(&collectCount)
+	jyDocsRpcUtil.GetJyDocsDB().Table("user_doc").Where("docId = ? and userId = ? and appId = ? and isCollection = 1", docId, userId, appId).Count(&collectCount)
 	if collectCount > 0 {
 		isCollect = true
 	}