Exclude deal

This commit is contained in:
mac 2026-07-15 15:14:48 +03:00
parent d8d942512c
commit 43bdcb29a9
5 changed files with 5 additions and 5 deletions

View File

@ -4211,7 +4211,7 @@ class CommonController extends ApiController
$sql = "UPDATE user_client_events SET user_id = $who_work WHERE client_id = $client_id AND type != 'step' AND type != 'file'"; $sql = "UPDATE user_client_events SET user_id = $who_work WHERE client_id = $client_id AND type != 'step' AND type != 'file'";
if ($requisition_id > 0) if ($requisition_id > 0)
$sql = "UPDATE user_client_events SET user_id = $who_work WHERE req_id = $requisition_id AND type != 'step' AND type != 'file'"; $sql = "UPDATE user_client_events SET user_id = $who_work WHERE req_id = $requisition_id AND type != 'step' AND type != 'file' AND (type != 'deal' OR deal_id = 0 OR deal_id IS NULL)";
if (!mysql_query($sql)) { if (!mysql_query($sql)) {
$error = true; $error = true;

View File

@ -1431,7 +1431,7 @@ class RequisitionsController extends ApiController
} }
if ($confirm == 1) { if ($confirm == 1) {
$sqlup = "UPDATE user_client_events SET user_id=".$new_who_work." WHERE req_id=".$row['id']." and `type` != 'step' and `type` != 'file'"; $sqlup = "UPDATE user_client_events SET user_id=".$new_who_work." WHERE req_id=".$row['id']." and type NOT IN ('step', 'file') AND NOT (type = 'deal' AND deal_id > 0)";
if (!$pdo->query($sqlup)) { if (!$pdo->query($sqlup)) {
$error = true; $error = true;
$errors[] = $pdo->db->error(); $errors[] = $pdo->db->error();

View File

@ -516,7 +516,7 @@ class MaxClass {
$this->db->query("INSERT INTO clients_funnel_step (req_id) VALUES ({$field_val})"); $this->db->query("INSERT INTO clients_funnel_step (req_id) VALUES ({$field_val})");
} }
} }
$sql = "UPDATE user_client_events SET user_id={$user_id} WHERE req_id={$field_val} and type != 'step' and type != 'file'"; $sql = "UPDATE user_client_events SET user_id={$user_id} WHERE req_id={$field_val} and type != 'step' and type != 'file' and (type != 'deal' or deal_id = 0 or deal_id IS NULL)";
$this->db->query($sql); $this->db->query($sql);
$sql = "UPDATE `events_clients` SET `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE req_id = {$field_val} AND event IN ('transmitted', 'notadopted')"; $sql = "UPDATE `events_clients` SET `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE req_id = {$field_val} AND event IN ('transmitted', 'notadopted')";
$this->db->query($sql); $this->db->query($sql);

View File

@ -418,7 +418,7 @@ class Telegram {
$this->db->query("INSERT INTO clients_funnel_step (req_id) VALUES ({$field_val})"); $this->db->query("INSERT INTO clients_funnel_step (req_id) VALUES ({$field_val})");
} }
} }
$sql = "UPDATE user_client_events SET user_id={$user_id} WHERE req_id={$field_val} and type != 'step' and type != 'file'"; $sql = "UPDATE user_client_events SET user_id={$user_id} WHERE req_id={$field_val} and type != 'step' and type != 'file' and (type != 'deal' or deal_id = 0 or deal_id IS NULL)";
$this->db->query($sql); $this->db->query($sql);
$sql = "UPDATE `events_clients` SET `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE req_id = {$field_val} AND event IN ('transmitted', 'notadopted')"; $sql = "UPDATE `events_clients` SET `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE req_id = {$field_val} AND event IN ('transmitted', 'notadopted')";
$this->db->query($sql); $this->db->query($sql);

View File

@ -683,7 +683,7 @@ class User {
$rez=mysql_query($sql); $rez=mysql_query($sql);
// перенос всех событий тому, кому отдаем заявки // перенос всех событий тому, кому отдаем заявки
$sql="UPDATE user_client_events SET user_id=$newWhoWorkReq WHERE user_id=$id AND req_id>0"; $sql="UPDATE user_client_events SET user_id=$newWhoWorkReq WHERE user_id=$id AND req_id>0 AND (type != 'deal' or deal_id = 0 or deal_id IS NULL)";
$rez=mysql_query($sql); $rez=mysql_query($sql);