mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 10:56:50 +08:00
Merge branch 'stat' of https://codeup.aliyun.com/6265f483e4166464dc2f9c14/boeu/baseservers into stat
This commit is contained in:
@@ -296,7 +296,7 @@ public interface ICourseService {
|
||||
/**
|
||||
* 查询出三条关联兴趣爱好的数据
|
||||
* */
|
||||
List<Course> userHobbyList(String aid);
|
||||
List<Course> userHobbyList(String aid,String orderField,Boolean orderAsc);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -958,7 +958,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Course> userHobbyList(String aid) {
|
||||
public List<Course> userHobbyList(String aid,String orderField,Boolean orderAsc) {
|
||||
List<Course> courses = new ArrayList<>();
|
||||
if(StringUtil.isNotBlank(aid)){
|
||||
String sql="select ref_id from boe_user_hobby where aid='"+aid+"'";
|
||||
@@ -977,6 +977,19 @@ public class CourseServiceImpl implements ICourseService {
|
||||
iFieldFilters.add(FieldFilters.in("sysType2",strings));
|
||||
iFieldFilters.add(FieldFilters.in("sysType3",strings));
|
||||
builder.addFilter(FieldFilters.or(iFieldFilters));
|
||||
OrderCondition oc=null;
|
||||
if(StringUtils.isNotBlank(orderField)) {
|
||||
if(orderAsc==null || orderAsc) {
|
||||
oc=OrderCondition.asc(orderField);
|
||||
}else {
|
||||
oc=OrderCondition.desc(orderField);
|
||||
}
|
||||
}else {
|
||||
//oc=OrderCondition.desc("id");
|
||||
//默认按发布时间排序
|
||||
oc=OrderCondition.desc("publishTime");
|
||||
}
|
||||
builder.addOrder(oc);
|
||||
courses=courseDao.findList(builder.builder());
|
||||
}
|
||||
return courses;
|
||||
|
||||
@@ -132,7 +132,7 @@ public class PortalIndexApi extends ApiBaseController{
|
||||
PageList<Course> coursePageList = courseService.findSimplePage(pager.getPageIndex(), pager.getPageSize(),dto);
|
||||
|
||||
String aid = this.getCurrent().getAccountId();
|
||||
List<Course> courses = courseService.userHobbyList(aid);
|
||||
List<Course> courses = courseService.userHobbyList(aid,dto.getOrderField(),dto.getOrderAsc());
|
||||
|
||||
//计算下标,
|
||||
int i=0;
|
||||
|
||||
Reference in New Issue
Block a user