update filter order
This commit is contained in:
@@ -3,18 +3,17 @@ class Transactions::OrdersController < ApplicationController
|
||||
def index
|
||||
|
||||
filter = params[:filter]
|
||||
count = params[:count]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? || from.nil? || to.nil?
|
||||
if filter.nil? && from.nil? && to.nil? && count.nil?
|
||||
orders = Order.order("order_id desc")
|
||||
puts "ssssss"
|
||||
else
|
||||
orders = Order.search(filter,from,to)
|
||||
# if order.count > 0
|
||||
# orders = order
|
||||
# else
|
||||
# orders = Order.order("order_id desc")
|
||||
# end
|
||||
orders = Order.search(filter,from,to,count)
|
||||
puts "aaaaa"
|
||||
|
||||
end
|
||||
|
||||
if !orders.nil?
|
||||
@@ -22,6 +21,7 @@ class Transactions::OrdersController < ApplicationController
|
||||
else
|
||||
@orders = []
|
||||
end
|
||||
puts @orders.to_json
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @orders }
|
||||
|
||||
Reference in New Issue
Block a user