mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
roles message datatatables
This commit is contained in:
@ -770,7 +770,7 @@ class ChatModel extends Model
|
||||
->join("users u", "u.id = cm.sender_id", 'left')
|
||||
->where("chats.presupuesto_id is NOT NULL", NULL, FALSE);
|
||||
|
||||
if (auth()->user()->inGroup("admin") == false) {
|
||||
if (auth()->user()->inGroup("cliente-administrador","cliente")) {
|
||||
$query->where('presupuestos.cliente_id', auth()->user()->cliente_id)
|
||||
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
|
||||
}
|
||||
@ -801,7 +801,7 @@ class ChatModel extends Model
|
||||
->join("presupuestos", "presupuestos.id = pedidos_linea.presupuesto_id", 'left')
|
||||
->where("chats.pedido_id is NOT NULL", NULL, FALSE);
|
||||
|
||||
if (auth()->user()->inGroup("admin") == false) {
|
||||
if (auth()->user()->inGroup("cliente-administrador","cliente")) {
|
||||
$query->where('presupuestos.cliente_id', auth()->user()->cliente_id)
|
||||
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
|
||||
}
|
||||
@ -831,12 +831,10 @@ class ChatModel extends Model
|
||||
->join("facturas", "facturas.id = chats.factura_id", "left")
|
||||
->where("chats.factura_id is NOT NULL", NULL, FALSE);
|
||||
|
||||
if (auth()->user()->inGroup("admin") == false) {
|
||||
if (auth()->user()->inGroup("admin") == false) {
|
||||
if (auth()->user()->inGroup("cliente-administrador","cliente")) {
|
||||
$query->where('facturas.cliente_id', auth()->user()->cliente_id)
|
||||
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
|
||||
}
|
||||
}
|
||||
return $query->groupBy('chatMessageId');
|
||||
}
|
||||
public function createNewDirectChat(string $title, string $message, array $users)
|
||||
|
||||
Reference in New Issue
Block a user