check shop code for new order

This commit is contained in:
phyusin
2018-05-11 17:03:53 +06:30
parent a896617a4d
commit 0a07b3479d
7 changed files with 48 additions and 16 deletions

View File

@@ -3,10 +3,11 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
disconnected: function() {},
received: function(data) {
received: function(data) {
var shop_code = data.shop_code;
var order = data.data;
if(order.length > 0){
$('.order_reserve_cable tbody').html("");
$('.custom-table.'+shop_code+'_order_reserve_cable tbody').html("");
$(".nav-item.red > a > p.num").text(order.length);
$.each(order, function(key,value){
var active_class = "";
@@ -42,7 +43,7 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
+'</td>'
+' </tr>';
$('.custom-table.order_reserve_cable tbody').append(row);
$('.custom-table.'+shop_code+'_order_reserve_cable tbody').append(row);
});
}