|
@@ -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 ds.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 jydocs.doc_statistics ds on(dr.doc_id=ds.docId) left join jydocs.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 dr.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 jydocs.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=?"
|
|
@@ -22,7 +22,7 @@ func GetRecDoc(regionState int, docClassCode string) (recList []map[string]inter
|
|
|
// 精选文档
|
|
|
// 热门文档和会员免费文档
|
|
|
rs := BaseMysql.SelectBySql(query, values...)
|
|
|
- if rs != nil || len(*rs) == 0 {
|
|
|
+ if rs == nil || len(*rs) == 0 {
|
|
|
return []map[string]interface{}{}
|
|
|
}
|
|
|
return *rs
|