fix : cliente show departments chats

This commit is contained in:
amazuecos
2024-09-26 07:33:34 +00:00
parent c651db61ff
commit a6dbe6de07
2 changed files with 6 additions and 4 deletions

View File

@ -71,8 +71,10 @@ class ChatDeparmentModel extends Model
"users",
"chat_department_users.user_id = users.id",
'left'
)->where("chat_departments.type",$type)
->where("chat_department_users.user_id",auth()->user()->id);
)->where("chat_departments.type",$type);
if(auth()->user()->cliente_id == null){
$query->where("chat_department_users.user_id",auth()->user()->id);
}
$results = $query->get()->getResultArray();
// Create the desired structure