|
|
@@ -82,7 +82,7 @@ func GetLatest(page, perPage, recommend, depart, rank int64, useCache bool) (lis
|
|
|
sql := `
|
|
|
select a.* from
|
|
|
live_broads a left join depart_records_live_broads b on a.id=b.live_broad_id
|
|
|
- where a.recommend > ? and b.depart_record_id=? and (find_in_set(?,a.rank_strs) or a.rank_strs="" )
|
|
|
+ where a.recommend > ? and (b.depart_record_id=? or b.depart_record_id is null ) and (find_in_set(?,a.rank_strs) or a.rank_strs="" )
|
|
|
order by recommend desc, created_at desc limit %d, %d ;
|
|
|
`
|
|
|
sql = fmt.Sprintf(sql, (page-1)*perPage, perPage)
|
|
|
@@ -119,7 +119,7 @@ func GetLatestCount(recommend, depart, rank int64) int64 {
|
|
|
sql := `
|
|
|
select count(DISTINCT a.id) as count from
|
|
|
live_broads a left join depart_records_live_broads b on a.id=b.live_broad_id
|
|
|
- where a.recommend > ? and b.depart_record_id=? and (find_in_set(?,a.rank_strs) or a.rank_strs="" ) ;
|
|
|
+ where a.recommend > ? and (b.depart_record_id=? or b.depart_record_id is null ) and (find_in_set(?,a.rank_strs) or a.rank_strs="" ) ;
|
|
|
`
|
|
|
err := o.Raw(sql, recommend, depart, rank).QueryRow(ret)
|
|
|
if err != nil {
|