Exclude deal
This commit is contained in:
parent
d8d942512c
commit
43bdcb29a9
@ -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'";
|
||||
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)) {
|
||||
$error = true;
|
||||
|
||||
@ -1431,7 +1431,7 @@ class RequisitionsController extends ApiController
|
||||
}
|
||||
|
||||
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)) {
|
||||
$error = true;
|
||||
$errors[] = $pdo->db->error();
|
||||
|
||||
@ -516,7 +516,7 @@ class MaxClass {
|
||||
$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);
|
||||
$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);
|
||||
|
||||
@ -418,7 +418,7 @@ class Telegram {
|
||||
$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);
|
||||
$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);
|
||||
|
||||
@ -683,7 +683,7 @@ class User {
|
||||
$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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user