promotions product issue and membership setting checked

This commit is contained in:
Aung Kyaw Phyoe
2019-02-08 14:07:18 +06:30
parent 8112ee95f1
commit d7d437e1d9
5 changed files with 50 additions and 37 deletions

View File

@@ -103,9 +103,10 @@ class Settings::PromotionsController < ApplicationController
arr_inst = []
item_inst = MenuItemInstance.find_by_item_instance_code(params[:item_instance_code])
if item_inst.nil?
product = Product.where("item_code = ?",params[:item_instance_code]).pluck(:name,:item_code)
res.push(product.name)
res.push(product.item_code)
product = Product.where("item_code = ?",params[:item_instance_code])
product.each do |pdt|
res.push({pdt.item_code => pdt.name})
end
else
# menu_item = item_inst.menu_item.pluck(:name,:item_code)
# res.push(item_inst.item_instance_name)