<?php
$begin = hrtime(true);
// Соединение с БД
$end = hrtime(true);
echo $end - $begin;
const increaseSalary = () => api.getEmployees()
.then((employees) => {
const employee = employees.reduce(
(acc, cur) => (acc.salary > cur.salary ? cur : acc),
{ salary: Infinity },
);
const newSalary = (employee.salary * 1.2) | 0;
return api.setEmployeeSalary(employee.id, newSalary);
}).then(result) => {
if (result.salary !== newSalary) {
throw 'API Error, salary has not increased';
}
return api.notifyEmployee(
employee.id,
`Hello, ${employee.name}! Congratulations, your new salary is ${newSalary}!`,
);
}).then(
() => true,
).catch((e) => {
api.notifyAdmin(e.message);
return false;
});
newDiv
- переменная. 'newDiv'
- строка. SELECT *
FROM `customer_session` AS `s`
LEFT JOIN `visit` AS `v`
ON `v`.`session_id` = `s`.`session_id`
AND `v`.`customer_id` = `s`.`customer_id`
AND `v`.`date` = '2022-05-06'
WHERE `s`.`session_id` = 1