update conflict js
This commit is contained in:
@@ -3,21 +3,23 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
|
||||
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(data) {
|
||||
var order = data.data;
|
||||
var shop_code = data.shop_code;
|
||||
if(order.length > 0){
|
||||
var order_lists = "";
|
||||
$.each(order, function(key, value){
|
||||
if(key==0){
|
||||
order_lists = value.order_reservation_id;
|
||||
}else if(key == (order.length - 1)){
|
||||
order_lists += ' and ' + value.order_reservation_id;
|
||||
}else{
|
||||
order_lists += ', ' + value.order_reservation_id;
|
||||
}
|
||||
});
|
||||
|
||||
received: function(data) {
|
||||
var hostname = location.hostname.trim();
|
||||
if(data.from == "" || hostname == data.from)
|
||||
{
|
||||
var order = data.data;
|
||||
var shop_code = data.shop_code;
|
||||
if(order.length > 0){
|
||||
var order_lists = "";
|
||||
$.each(order, function(key, value){
|
||||
if(key==0){
|
||||
order_lists = value.order_reservation_id;
|
||||
}else if(key == (order.length - 1)){
|
||||
order_lists += ' and ' + value.order_reservation_id;
|
||||
}else{
|
||||
order_lists += ', ' + value.order_reservation_id;
|
||||
}
|
||||
});
|
||||
// alert(order_lists);
|
||||
if (typeof checkNewOrderAlert !== 'undefined' && $.isFunction(checkNewOrderAlert)) {
|
||||
checkNewOrderAlert(shop_code, order_lists);
|
||||
|
||||
Reference in New Issue
Block a user