edti dashboard
This commit is contained in:
@@ -5,6 +5,14 @@ class HomeController < ApplicationController
|
||||
redirect_to new_member_session_path
|
||||
end
|
||||
def dashboard
|
||||
today= Date.today.strftime("%Y-%m-%d")
|
||||
@users=User.all
|
||||
@batches=Batch.joins('inner join users on users.id=batches.user_id')
|
||||
.where("to_char(batches.created_at,'YYYY-mm-dd')=?",today)
|
||||
.select('batches.*,users.name as user_name').order('batches.id desc')
|
||||
|
||||
@batchLineItems=BatchLineItem.joins('inner join batches on batches.id=batch_line_items.batch_id').select('batch_line_items.*,batches.order_ref as batch_name')
|
||||
.where("to_char(batches.created_at,'YYYY-mm-dd')=?",today)
|
||||
.page(params[:page]).per(5)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user