$categoriesForSitemap = get_terms([
'taxonomy' => 'category',
'hide_empty' => false,
'number' => 0,
]);
$script_url . '?t=' . time();
// set expires header
header('Expires: Thu, 1 Jan 1970 00:00:00 GMT');
// set cache-control header
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0',false);
// set pragma header
header('Pragma: no-cache');
=IF(ISBLANK(A1); NOW(); A1)
создаст ошибку циклической зависимости. Если нужно фиксировать даты, то посмотрите в сторону использования AppsScript async function main()
{
let canvas = document.querySelector("#canvas");
canvas.width = 200;
canvas.height = 200;
let ctx = canvas.getContext('2d');
function fun(){
return new Promise((resolve, reject) => {
let dataUrl = "no";
let img = new Image()
img.onload = () => {
ctx.drawImage(img, 0, 0, img.width, img.height);
dataUrl = canvas.toDataURL();
resolve(dataUrl)
}
img.onerror = reject
img.src = "/img/fallback/logo-adunit.jpg";
})
}
let dataUrl = await fun();
document.querySelector("#print").innerText = dataUrl;
}
main()
SELECT <...>
FROM
"clients"
LEFT JOIN "clients_selections" ON "clients"."id" = "clients_selections"."client_id"
LEFT JOIN (
SELECT
"selections"."id",
"selections"."name",
"selections"."wishes",
"selections"."created_at",
"selections"."updated_at",
"statuses"."id",
"statuses"."name",
COUNT("tours"."id")
FROM
"selections"
INNER JOIN "statuses" ON "selections"."status_id" = "statuses"."id"
LEFT JOIN "tours" ON "tours"."selection_id" = "selections"."id"
GROUP BY
"selections"."id",
"statuses"."id"
) AS "selections_full"
ON "clients_selections"."id" = "selections_full"."id"