mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
fix chat view
This commit is contained in:
@ -72,13 +72,15 @@ class ChatService extends BaseService
|
||||
$cliente_contacto = $this->clienteContactoModel->find($data["client"]);
|
||||
if ($cliente_contacto) {
|
||||
$userClienteContacto = $cliente_contacto->cliente()->user();
|
||||
$cliente_in_department = $this->chatDepartmentUserModel
|
||||
->where('chat_department_id', $chatDepartmentId)
|
||||
->where('user_id', $userClienteContacto->id)
|
||||
->where($this->modelFkMap[$model], $modelId)
|
||||
->first();
|
||||
if ($cliente_in_department == null) {
|
||||
$this->chatDepartmentUserModel->insert(['chat_department_id' => $chatDepartmentId, 'user_id' => $userClienteContacto->id, $this->modelFkMap[$model] => $modelId]);
|
||||
if ($userClienteContacto) {
|
||||
$cliente_in_department = $this->chatDepartmentUserModel
|
||||
->where('chat_department_id', $chatDepartmentId)
|
||||
->where('user_id', $userClienteContacto->id)
|
||||
->where($this->modelFkMap[$model], $modelId)
|
||||
->first();
|
||||
if ($cliente_in_department == null) {
|
||||
$this->chatDepartmentUserModel->insert(['chat_department_id' => $chatDepartmentId, 'user_id' => $userClienteContacto->id, $this->modelFkMap[$model] => $modelId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -165,7 +167,7 @@ class ChatService extends BaseService
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function getHebras(string $model, int $modelId): array
|
||||
{
|
||||
$chats = $this->chatModel->where('chat_department_id', null)
|
||||
|
||||
Reference in New Issue
Block a user