customer filter with card no

This commit is contained in:
Myat Zin Wai Maw
2019-04-22 17:24:20 +06:30
parent a74573709a
commit 8f81eb8e4a
3 changed files with 26 additions and 7 deletions

View File

@@ -6,8 +6,13 @@ class Crm::CustomersController < BaseCrmController
# GET /crm/customers.json
def index
filter = params[:filter]
filter_card_no = params[:filter_card_no]
type = params[:type]
if filter.nil?
if filter_card_no==""
@crm_customers = Customer.all
elsif !filter_card_no.nil?
@crm_customers=Customer.where("card_no=?",filter_card_no)
elsif filter.nil? || filter_card_no==""
@crm_customers = Customer.all
else
@crm_customers = Customer.search(filter)