Files
sx-fc/app/controllers/transactions/surveys_controller.rb
Myat Zin Wai Maw 79598c0126 shop code
2019-12-10 15:18:48 +06:30

25 lines
544 B
Ruby

class Transactions::SurveysController < ApplicationController
def index
filter = params[:filter]
from = params[:from]
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@surveys = Survey.where("shop_code='#{@shop.shop_code}'")
else
@surveys = Survey.search(filter,from,to).where("shop_code='#{@shop.shop_code}'")
end
@filter = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb
format.xls
format.json { render json: @surveys }
end
end
end