Merge branch 'fix/message-notification' into 'dev/presu_cliente_v2'

Fix/message notification

See merge request jjimenez/safekat!359
This commit is contained in:
Alvaro
2024-11-06 21:09:05 +00:00

View File

@ -208,7 +208,8 @@ class ChatModel extends Model
"pedidos.id as title"
])
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
->join("pedidos","pedidos.id = chats.pedido_id","left");
->join("pedidos","pedidos.id = chats.pedido_id","left")
->where('chats.chat_department_id is NOT NULL', NULL, FALSE);
if(count($pedidos)>0){
$q->whereIn("pedidos.id",$pedidos);
}else{
@ -240,7 +241,9 @@ class ChatModel extends Model
"facturas.numero as title"
])
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
->join("facturas","facturas.id = chats.factura_id","left");
->join("facturas","facturas.id = chats.factura_id","left")
->where('chats.chat_department_id is NOT NULL', NULL, FALSE);
if(count($facturas)>0){
$q->whereIn("facturas.id",$facturas);
}else{
@ -272,7 +275,9 @@ class ChatModel extends Model
"presupuestos.titulo as title"
])
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
->join("presupuestos","presupuestos.id = chats.presupuesto_id","left");
->join("presupuestos","presupuestos.id = chats.presupuesto_id","left")
->where('chats.chat_department_id is NOT NULL', NULL, FALSE);
if(count($presupuestos)>0){
$q->whereIn("presupuestos.id",$presupuestos);
}else{