select c.title, count(p.product_id )
from (
select title, category_id from categories c where c.category_id IN (1,2)
UNION
select
(select title from categories c1 where c1.category_id = c.parent_id) as title,
category_id
from categories c where parent_id IN (1,2)
) c
JOIN products p ON p.category_id = c.category_id
GROUP BY c.title
document.location.href += "&" + document.referrer
.split("?")[1]
.split("#")[0]
.split("&")
.filter(str => str.indexOf("utm_") > -1)
.join("&");
document.location.href += document.referrer.indexOf("?") > -1 ?
"&" + document.referrer
.split("?")[1]
.split("#")[0]
.split("&")
.filter(str => str.indexOf("utm_") > -1)
.join("&") : "";
var checker = {
// получить координаты углов объекта
getRectangle: function (el) {
return {
left: el.offsetLeft,
top: el.offsetTop,
right: el.offsetLeft + el.offsetWidth,
bottom: el.offsetTop + el.offsetHeight
}
},
// проверка на пересечение
collide: function (el1, el2) {
var rect1 = this.getRectangle(el1);
var rect2 = this.getRectangle(el2);
return !(
rect1.top > rect2.bottom ||
rect1.right < rect2.left ||
rect1.bottom < rect2.top ||
rect1.left > rect2.right
);
},
// проверка на совпадение
inside: function (el1, el2) {
var rect1 = this.getRectangle(el1);
var rect2 = this.getRectangle(el2);
return (
((rect2.top <= rect1.top) && (rect1.top <= rect2.bottom)) &&
((rect2.top <= rect1.bottom) && (rect1.bottom <= rect2.bottom)) &&
((rect2.left <= rect1.left) && (rect1.left <= rect2.right)) &&
((rect2.left <= rect1.right) && (rect1.right <= rect2.right))
);
}
}
...
/ip address add address=1.1.1.3/29 interface=WAN
....
Далее список NetMap адресов которым «привязываем» белые
/ip firewall nat add chain=srcnat src-address=192.168.0.3 action=netmap to-addresses=1.1.1.3
/ip firewall nat add chain=dstnat dst-address=1.1.1.3 action=netmap to-addresses=192.168.0.3
jQuery(".sp-body.folded").hide();
jQuery(".sp-head").each(function(){
$this = jQuery(this);
$this.addClass("unfolded");
$this.next().slideDown("fast");
$this.next().removeClass("folded");
$this.prop('title', title.folded);
});
var isUnfolded = false;
function toggleSpoilers() {
jQuery(".sp-head").each(function(){
$this = jQuery(this);
if(isUnfolded) {
$this.removeClass("unfolded");
$this.next().slideUp("fast");
$this.next().addClass("folded");
$this.prop('title', title.unfolded);
} else {
$this.addClass("unfolded");
$this.next().slideDown("fast");
$this.next().removeClass("folded");
$this.prop('title', title.folded);
}
});
isUnfolded = !isUnfolded;
}