后台作业列表添加编程作业过滤

This commit is contained in:
huang 2017-02-21 14:45:18 +08:00
parent 465f4c91bb
commit e6deabadba
2 changed files with 6 additions and 2 deletions

View File

@ -978,7 +978,11 @@ class AdminController < ApplicationController
#作业 #作业
def homework def homework
#@homework = HomeworkCommon.order('end_time desc') #@homework = HomeworkCommon.order('end_time desc')
if params[:type] == "2"
@homework = HomeworkCommon.where(:homework_type => 2).order( 'created_at desc ')
else
@homework = HomeworkCommon.order( 'created_at desc ') @homework = HomeworkCommon.order( 'created_at desc ')
end
@homework = paginateHelper @homework,30 @homework = paginateHelper @homework,30
@page = (params['page'] || 1).to_i - 1 @page = (params['page'] || 1).to_i - 1
respond_to do |format| respond_to do |format|

View File

@ -1,7 +1,7 @@
<h3> <h3>
<%=l(:label_user_homework)%> <%=l(:label_user_homework)%>
</h3> </h3>
<p><%= link_to "编程作业", admin_homework_path(:type => "2") %></p>
<div class="autoscroll"> <div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed"> <table class="list" style="width: 100%;table-layout: fixed">
<thead> <thead>