xuzhiheng 4 vuotta sitten
vanhempi
commit
1a8eb7214f
1 muutettua tiedostoa jossa 9 lisäystä ja 9 poistoa
  1. 9 9
      services/stdlib/docGet.go

+ 9 - 9
services/stdlib/docGet.go

@@ -13,7 +13,7 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 	// docPrice := 0
 	var buyCount int64
 	isbuy := false
-	jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ?", docId, userId, appId).Count(&buyCount)
+	jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ? and category = 1", docId, userId, appId).Count(&buyCount)
 	if buyCount > 0 {
 		isbuy = true
 	}
@@ -29,14 +29,14 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 			Msg:   "ok",
 			IsBuy: isbuy,
 			DocDeail: &stdlib.DocInfo{
-				DocId:       doc.Id,
-				DocName:     doc.DocName,
-				Price:       int64(doc.Price),
-				DocFileSize: int64(doc.DocFileSize),
-				DocPageSize: int64(doc.DocPageSize),
-				Tags:        doc.DocTags,
-				// DownTimes     :doc.DownTimes,
-				// ViewTimes    :doc.ViewTimes,
+				DocId:        doc.Id,
+				DocName:      doc.DocName,
+				Price:        int64(doc.Price),
+				DocFileSize:  int64(doc.DocFileSize),
+				DocPageSize:  int64(doc.DocPageSize),
+				Tags:         doc.DocTags,
+				DownTimes:    docStatistics["downTimes"].(int64),
+				ViewTimes:    docStatistics["viewTimes"].(int64),
 				UploadDate:   doc.UploadDate.Format("2006-01-02 15:04:05"),
 				DocSummary:   doc.DocSummary,
 				DocFileType:  int64(doc.DocFileType),