Commit 2bc19e01620ea346d8f945588a4223f16c6b0546
1 parent
45c19786
直播业务优化
Showing
3 changed files
with
25 additions
and
12 deletions
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| ... | ... | @@ -118,7 +118,7 @@ public class LiveController { |
| 118 | 118 | @GetMapping("/page") |
| 119 | 119 | public Object getListVideos(Model model,String activity_id,String start_date,String end_date, |
| 120 | 120 | String activity_name, Integer activity_status, Integer page,Integer pageSize, |
| 121 | - Integer shenhe_state, String orderByClause, String sp_desc, HttpSession session) { | |
| 121 | + Integer shenhe_state, String sp_desc, HttpSession session) { | |
| 122 | 122 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 123 | 123 | if(CommonUtils.isNull(sessionUser)){ |
| 124 | 124 | return "redirect:/users/login"; |
| ... | ... | @@ -126,7 +126,7 @@ public class LiveController { |
| 126 | 126 | Integer spid = sessionUser.getSpid(); |
| 127 | 127 | String userId = sessionUser.getUserId(); |
| 128 | 128 | if (CommonUtils.isNull(page)) page = 1; |
| 129 | - if (CommonUtils.isNull(pageSize)) pageSize = 30; | |
| 129 | + if (CommonUtils.isNull(pageSize)) pageSize = 20; | |
| 130 | 130 | if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { |
| 131 | 131 | ShySites shySite=sitesService.findspidBySpdesc(sp_desc); |
| 132 | 132 | if(CommonUtils.isNotNull(shySite)){ |
| ... | ... | @@ -137,6 +137,19 @@ public class LiveController { |
| 137 | 137 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { |
| 138 | 138 | spid = null; |
| 139 | 139 | } |
| 140 | + String orderByClause=""; | |
| 141 | + if(shenhe_state!=null&&shenhe_state==0){//审核状态:全部待领 | |
| 142 | + orderByClause="activity_start_time "; | |
| 143 | + }else if(shenhe_state!=null&&shenhe_state==1){//审核状态:待审核 | |
| 144 | + orderByClause="activity_start_time "; | |
| 145 | + }else if(shenhe_state!=null&&shenhe_state==2){//审核状态:已审核 | |
| 146 | + orderByClause="activity_start_time desc"; | |
| 147 | + }else{//审核状态:全部 | |
| 148 | + orderByClause="is_hot , activity_start_time "; | |
| 149 | + if(activity_status!=null &&(activity_status==0 ||activity_status==2 || activity_status==4)){//直播状态:结束、撤销、下线 | |
| 150 | + orderByClause="is_hot , activity_start_time desc"; | |
| 151 | + } | |
| 152 | + } | |
| 140 | 153 | PageInfo<ShyLive> livePage = liveService.getListContent(activity_name, start_date,end_date, |
| 141 | 154 | activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid, userId); |
| 142 | 155 | List<ShyLive> list = livePage.getList(); | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
| ... | ... | @@ -174,7 +174,7 @@ public class LiveServiceImpl { |
| 174 | 174 | } |
| 175 | 175 | criteria.andEqualTo("is_show", 1); |
| 176 | 176 | //排序 |
| 177 | - example.setOrderByClause("is_hot desc, activity_start_time asc"); | |
| 177 | +// example.setOrderByClause("is_hot desc, activity_start_time desc"); | |
| 178 | 178 | PageHelper.startPage(page, pageSize, true); |
| 179 | 179 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); |
| 180 | 180 | PageInfo<ShyLive> pageInfo = new PageInfo<>(shyLiveList); | ... | ... |
src/main/resources/templates/page/live.html
| ... | ... | @@ -79,17 +79,17 @@ |
| 79 | 79 | <div class="btn-group margin-bottom col-md-7" |
| 80 | 80 | style="padding: 0;"> |
| 81 | 81 | <div class="col-md-3" style="padding: 0"> |
| 82 | - <label for="activity_id" class="control-label cb-toolbar">直播id:</label> | |
| 82 | + <label for="activity_name" class="control-label cb-toolbar">直播名称:</label> | |
| 83 | 83 | <div class="col-sm-7" style="padding: 0;"> |
| 84 | - <input class="form-control" name="activity_id" type="text" | |
| 85 | - id="activity_id"> | |
| 84 | + <input class="form-control col-sm-2" name="activity_name" | |
| 85 | + type="text" id="activity_name"> | |
| 86 | 86 | </div> |
| 87 | 87 | </div> |
| 88 | 88 | <div class="col-md-3" style="padding: 0"> |
| 89 | - <label for="activity_name" class="control-label cb-toolbar">直播名称:</label> | |
| 89 | + <label for="activity_id" class="control-label cb-toolbar">直播id:</label> | |
| 90 | 90 | <div class="col-sm-7" style="padding: 0;"> |
| 91 | - <input class="form-control col-sm-2" name="activity_name" | |
| 92 | - type="text" id="activity_name"> | |
| 91 | + <input class="form-control" name="activity_id" type="text" | |
| 92 | + id="activity_id"> | |
| 93 | 93 | </div> |
| 94 | 94 | </div> |
| 95 | 95 | |
| ... | ... | @@ -196,14 +196,14 @@ |
| 196 | 196 | |
| 197 | 197 | <!-- </a> --> |
| 198 | 198 | <div class="form-group" th:if="${live.activity_status != 1 }"> |
| 199 | - <div style="height: 22vmin;background: pink;"> | |
| 199 | + <div style="height: 22vmin"> | |
| 200 | 200 | <img th:src='@{${live.cover_img_url}}' |
| 201 | 201 | alt="封面图" width="100%" height="100%"> |
| 202 | 202 | </div> |
| 203 | 203 | |
| 204 | 204 | </div> |
| 205 | 205 | <div class="form-group" th:if="${live.activity_status== 1 }"> |
| 206 | - <div style="height: 22vmin;background: pink;"> | |
| 206 | + <div style="height: 22vmin"> | |
| 207 | 207 | <embed name="cnlive" width="100%" height="100%" id="cnlive" |
| 208 | 208 | src="http://data.cnlive.com/export/UuidPlayerMain.swf" |
| 209 | 209 | th:flashVars="@{'hasBorder=false&appid=82_irej0pbo53&type=live&model=2&videoURL='+${live.rtmp_url}}" |
| ... | ... | @@ -629,7 +629,7 @@ |
| 629 | 629 | |
| 630 | 630 | /*时间插件*/ |
| 631 | 631 | $('.date').datetimepicker({ |
| 632 | - format : 'YYYY-MM-DD HH:mm', | |
| 632 | + format : 'YYYY-MM-DD', | |
| 633 | 633 | locale : "zh-CN", |
| 634 | 634 | toolbarPlacement : 'bottom', |
| 635 | 635 | showClear : true, | ... | ... |