Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
phyusin
2018-06-05 15:39:43 +06:30
5 changed files with 17 additions and 18 deletions

View File

@@ -157,15 +157,3 @@ $(document).ready(function() {
} }
//end Notificaiotn message //end Notificaiotn message
}); });
/* start order reservation function */
function audioPlayBackground(shop_code,audio){
// console.log(shop_code);
//audio play
var audio = new Audio('/'+audio); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
}
/* end order reservation function */

View File

@@ -580,3 +580,15 @@ function timeFormat(date){
return time; return time;
} }
/* end order reservation function */ /* end order reservation function */
/* start order reservation function */
function audioPlayBackground(shop_code,audio){
// console.log(shop_code);
//audio play
var audio = new Audio('/'+audio); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
}
/* end order reservation function */

View File

@@ -15,7 +15,6 @@
//= require BSBMaterial/turbolink_admin.js //= require BSBMaterial/turbolink_admin.js
//= require BSBMaterial/demo.js //= require BSBMaterial/demo.js
//= require custom.js //= require custom.js
//= require order_reservation.js
/* Constant Varaibles */ /* Constant Varaibles */
_CREDIT_PAYMENTS_ = "/   CREDIT PAYMENTS"; _CREDIT_PAYMENTS_ = "/   CREDIT PAYMENTS";

View File

@@ -16,17 +16,18 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
if status if status
if params[:customer_id] && !params[:customer_id].nil? if params[:customer_id] && !params[:customer_id].nil?
customer = OrderReservation.addCustomer(params) customer = OrderReservation.addCustomer(params)
customer_id = customer.id customer_id = customer.customer_id
else else
check_customer = Customer.find_by_email_and_membership_id_and_customer_type(params[:email],params[:membership_id],'Doemal') check_customer = Customer.find_by_email_and_membership_id_and_customer_type(params[:email],params[:membership_id],'Doemal')
if !check_customer.nil? if !check_customer.nil?
customer_id = check_customer.customer_id customer_id = check_customer.customer_id
else else
customer = OrderReservation.addCustomer(params) customer = OrderReservation.addCustomer(params)
customer_id = customer.id customer_id = customer.customer_id
end end
end end
if !customer_id.nil?
if customer_id.nil?
render :json => { :status => false, :message => "email and customer are already existed!" } render :json => { :status => false, :message => "email and customer are already existed!" }
else else
render :json => { :status => true, :data => { :customer_id => customer_id} } render :json => { :status => true, :data => { :customer_id => customer_id} }

View File

@@ -22,7 +22,7 @@ class OrderReservation < ApplicationRecord
else else
gender = "Male" gender = "Male"
end end
if params[:customer_id].nil? if params[:customer_id] && !params[:customer_id].nil?
customer = Customer.find(params[:customer_id]) customer = Customer.find(params[:customer_id])
else else
customer = Customer.new customer = Customer.new
@@ -37,7 +37,6 @@ class OrderReservation < ApplicationRecord
customer.customer_type = "Doemal" customer.customer_type = "Doemal"
customer.tax_profiles = ["2"] customer.tax_profiles = ["2"]
customer.save customer.save
# unless customer.valid? # unless customer.valid?
# render json: { # render json: {
# status: 422, # status: 422,