wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://code.jquery.com/jquery.min.js', [], null, true);
$.ajax({
url: 'http://127.0.0.1:8080/login',
type: 'POST',
data: JSON.stringify({
username : 'rob6',
password : '9292271A'
}),
beforeSend: function (xhr) {
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
},
dataType: 'json',
success: function(response){
console.log(response)
},
error: function(response){
console.log(response)
}
});
data: JSON.stringify(new FormData($(this).get(0))),
SUM(IF(v.direct = 'UP', 1, -1)) AS post_rate
SUM(CASE WHEN v.direct = 'UP' THEN 1 ELSE -1 END) AS post_rate
Если вариантов может быть больше, выражение более громоздкое:SUM(CASE WHEN v.direct = 'UP' THEN 1 WHEN v.direct = 'DOWN' THEN -1 ELSE 0 END) AS post_rate
SELECT
order_id,
MAX(order_sum) AS d_sum
FROM table
GROUP BY order_id
HAVING COUNT(id) > 1
SELECT SUM(d_sum) AS a_sum
FROM (
SELECT
order_id,
MAX(order_sum) AS d_sum
FROM table
GROUP BY order_id
HAVING COUNT(id) > 1
) AS q
if ($i !== false) {
$('.stat_acc_block').html('<span class="stat_acc_block_text">Данные пользователя ' +
$('td #2').html() + ' ' + $('td #3').html() + '</span>');
Это сработает, если #2 и #3 - обыкновенные теги с контентом. Если же это input или select, то:$('.stat_acc_block').html('<span class="stat_acc_block_text">Данные пользователя ' +
$('td #2').val() + ' ' + $('td #3').val() + '</span>');
const nextSymbol = str[i + 1] || '';
const nextSymbol = str[i + 1];
const nextSymbol = '';
const nextSymbol = i + 1 < str.length ? str[i + 1] : '';
for i in range(len(array), -1, -1):
if len(array[i]) <= 2:
del array[i]
array = [array[i] for i in range(len(array)) if len(array[i]) >= 2]
CREATE TRIGGER shoes_after_insert AFTER INSERT ON shoes FOR EACH ROW
UPDATE supplier SET all_shoes = all_shoes + 1 WHERE supplier_id = NEW.supplier;