rewrite ^ /public-service/ break;
proxy_pass https://example.com;
proxy_set_header Host $host;
httpS://public-service.com
так что нужен не listen 80;
, а listen 443 ssl;
.мне по крону нужно будет зайти на ресурс в свой ЛК и подтянуть response json
2-3 раза в день
Это будет создавать меньшую нагрузки если я буду заходить из браузера и копировать, так что с этической точки зрения - все ОК
(
SELECT SUM(total_paid_real / conversion_rate)
FROM ps_orders o
WHERE o.id_customer = a.id_customer
AND o.id_shop IN (1)
AND o.valid = 1
) as total_spent,
SELECT SQL_NO_CACHE a.`id_customer`,
`firstname`,
`lastname`,
`email`,
a.`active` AS `active`,
`newsletter`,
`optin`,
a.date_add,
gl.name as title,
total_spents.total_spent
FROM `ps_customer` a
LEFT JOIN ps_gender_lang gl ON (a.id_gender = gl.id_gender AND gl.id_lang = 1)
LEFT JOIN (
SELECT o.id_customer, SUM(total_paid_real / conversion_rate) as total_spent
FROM ps_orders o
WHERE o.id_customer IN (SELECT id_customer FROM `ps_customer` a WHERE a.deleted = 0)
AND o.id_shop IN (1)
AND o.valid = 1
GROUP BY o.id_customer
) total_spents ON a.id_customer = total_spents.id_customer,
WHERE 1
AND a.`deleted` = 0
ORDER BY `date_add` DESC
LIMIT 0, 50
su - www-data -s /bin/bash
cd /home/www-data/www/blog
$arr = array(
'title_1' => '1111111',
'title_2' => '2222222',
'title_3' => '33333333',
'title_4' => '4444444444',
'text_1' => 'aaa111',
'text_2' => 'aaa222',
'text_3' => 'aaa333',
'text_4' => 'aaaa444',
'olol' => 'wssss',
'sssss' => 'xxxxxxx',
'zzzzzzzzzzzzzz' => 'w222222sss',
'vfdsvsvds' => 'vdszxvsdsdv',
);
$group = array();
foreach($arr as $key => $item) {
if(strpos($key, 'text') !== false || strpos($key, 'title') !== false) {
$group[substr($key, -1)][$key] = $item;
}
}
$group = array_values($group);
print_r($group);
Array
(
[0] => Array
(
[title_1] => 1111111
[text_1] => aaa111
)
[1] => Array
(
[title_2] => 2222222
[text_2] => aaa222
)
[2] => Array
(
[title_3] => 33333333
[text_3] => aaa333
)
[3] => Array
(
[title_4] => 4444444444
[text_4] => aaaa444
)
)
<?php
$array = [
'text_1' => ['I am so clever that sometimes I do not underst'],
//'text_2' => ['It is better to be hated for what you are than f.'],
'text_3' => ['Whenever you find yourself on the .'],
'text_4' => ['Whenever you find yourself on the side of the majority.'],
'title_1' => ['Responsive design'],
'title_2' => ['Web development'],
'title_3' => ['Customer support'],
'title_4' => ['images included'],
'title_text_1' => ['Unexpected'], //Может и такое быть
'_edit_lock' => ['1570606503:1'],
'_thumbnail_id' => ['59'],
'_edit_last' => ['1'],
'single_image_1' => ['94'],
'single_image_2' => ['91'],
'single_image_3' => ['92'],
'single_image_4' => ['93'],
];
$prefixes = [];
$maxIndex = 0;
foreach (array_keys($array) as $key) {
$parts = explode('_', $key);
$index = array_pop($parts);
if (!is_numeric($index)) {
continue;
}
$prefixes[implode('_', $parts)] = null;
if ($index > $maxIndex) {
$maxIndex = $index;
}
}
$output = [];
$prefixes = array_keys($prefixes);
for ($index = 1; $index <= $maxIndex; $index++) {
$row = [];
foreach ($prefixes as $prefix) {
$key = "{$prefix}_{$index}";
$row[$key] = @$array[$key];
}
$output[] = $row;
}
var_dump($output);