|
@@ -24,6 +24,13 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
|
|
|
// docPrice = docData["price"].(int)
|
|
|
docStatistics := map[string]interface{}{}
|
|
|
jyDocsRpcUtil.GetJyDocsDB().Table("doc_statistics").Where("docId = ? and appId = ?", docId, appId).First(&docStatistics)
|
|
|
+ downTimes, viewTimes := int64(0), int64(0)
|
|
|
+ if dt, ok := docStatistics["downTimes"].(int64); ok {
|
|
|
+ downTimes = dt
|
|
|
+ }
|
|
|
+ if vt, ok := docStatistics["viewTimes"].(int64); ok {
|
|
|
+ viewTimes = vt
|
|
|
+ }
|
|
|
docCheck := stdlib.DocGetCheckResp{
|
|
|
Code: 1,
|
|
|
Msg: "ok",
|
|
@@ -35,8 +42,8 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
|
|
|
DocFileSize: int64(doc.DocFileSize),
|
|
|
DocPageSize: int64(doc.DocPageSize),
|
|
|
Tags: doc.DocTags,
|
|
|
- DownTimes: docStatistics["downTimes"].(int64),
|
|
|
- ViewTimes: docStatistics["viewTimes"].(int64),
|
|
|
+ DownTimes: downTimes,
|
|
|
+ ViewTimes: viewTimes,
|
|
|
UploadDate: doc.UploadDate.Format("2006-01-02 15:04:05"),
|
|
|
DocSummary: doc.DocSummary,
|
|
|
DocFileType: int64(doc.DocFileType),
|