finished order and sales in setting
This commit is contained in:
@@ -30,6 +30,15 @@ class Crm::CustomersController < BaseCrmController
|
||||
# GET /crm/customers/1
|
||||
# GET /crm/customers/1.json
|
||||
def show
|
||||
@orders = Order.where("customer_id=?", params[:id])
|
||||
|
||||
if @orders
|
||||
@order_items = []
|
||||
@orders.each do |bo|
|
||||
@order_items = @order_items + bo.order_items
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# GET /crm/customers/new
|
||||
@@ -108,6 +117,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /crm/customers/1
|
||||
# PATCH/PUT /crm/customers/1.json
|
||||
@@ -158,24 +168,6 @@ class Crm::CustomersController < BaseCrmController
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /crm/customers/1
|
||||
# DELETE /crm/customers/1.json
|
||||
|
||||
# def get_sale_id
|
||||
|
||||
# @sale_id = params[:sale_id]
|
||||
# @crm_customers = Customer.all
|
||||
# @crm_customer = Customer.new
|
||||
# @membership = Customer.get_member_group
|
||||
# if @membership["status"] == true
|
||||
# @member_group = @membership["data"]
|
||||
# end
|
||||
# respond_to do |format|
|
||||
# format.html { render action: "index"}
|
||||
# format.json { render json: @crm_customers }
|
||||
# end
|
||||
# end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_crm_customer
|
||||
|
||||
Reference in New Issue
Block a user