Эх сурвалжийг харах

feat:文库推荐接口调整

fuwencai 1 жил өмнө
parent
commit
853f690e13

+ 2 - 2
jydocs-back/public/recDoc.go

@@ -9,9 +9,9 @@ func GetRecDoc(regionState int, docClassCode string) (recList []map[string]inter
 	query := ""
 	values := []interface{}{regionState}
 	if regionState == RegionStatePremium {
-		query = `SELECT dr.doc_id,dr.create_date,d.docName,d.docPageSize,d.docFileSize,ds.downTimes,ds.viewTimes,d.uploadDate,d.docSummary,d.docFileType,d.previewImgId,d.productType,d.source,d.docTags FROM jydocs.doc_recommend dr left join doc_statistics ds  on(dr.doc_id=ds.docId)  left join doc  d on  dr.doc_id=d.id  where   dr.region_state=?  order by viewTimes desc;`
+		query = `SELECT dr.doc_id,dr.create_date,d.docName,d.docPageSize,d.docFileSize,ds.downTimes,ds.viewTimes,d.uploadDate,d.docSummary,d.docFileType,d.previewImgId,d.productType,d.source,d.docTags FROM jydocs.doc_recommend dr left join doc_statistics ds  on(dr.doc_id=ds.docId)  left join doc  d on  dr.doc_id=d.id  where   dr.region_state=?  order by ds.viewTimes desc;`
 	} else {
-		qBase := `SELECT dr.create_date,dr.doc_id,dr.create_date,d.docName,d.docPageSize,d.docFileSize,d.uploadDate,d.docSummary,d.docFileType,d.previewImgId,d.productType,d.source,d.docTags FROM jydocs.doc_recommend dr     left join doc  d on  dr.doc_id=d.id  where  dr.region_state==? %s   order by create_date desc`
+		qBase := `SELECT dr.create_date,dr.doc_id,dr.create_date,d.docName,d.docPageSize,d.docFileSize,d.uploadDate,d.docSummary,d.docFileType,d.previewImgId,d.productType,d.source,d.docTags FROM jydocs.doc_recommend dr     left join doc  d on  dr.doc_id=d.id  where  dr.region_state==? %s   order by dr.create_date desc`
 		and := ""
 		if regionState == RegionStateHot {
 			and = "	and dr.doc_class_code=?"

+ 1 - 0
jydocs-back/servers/stdDoc.go

@@ -315,6 +315,7 @@ func (stdDoc *StdDoc) DocRecommend() {
 		var regionState int
 		if tag != "" {
 			regionState = public.RegionStateHot
+			tag = public.DocClassInfo[tag]
 		} else if productType == public.ProductTypeMemberFree {
 			regionState = public.RegionStateMemberFree
 		} else if productType == public.ProductTypePremium {