mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
fix chat department message total count
This commit is contained in:
@ -611,5 +611,17 @@ class ChatModel extends Model
|
||||
return $q->get()->getResultObject();
|
||||
|
||||
}
|
||||
public function getChatDepartmentMessagesCount(int $chat_id,int $chat_department_id) : int
|
||||
{
|
||||
$q = $this->builder()->select([
|
||||
"chat_messages.id"
|
||||
])
|
||||
->join("chat_messages","chat_messages.chat_id = chats.id",'left')
|
||||
->where("chats.chat_department_id",$chat_department_id)
|
||||
->where("chats.id",$chat_id)
|
||||
->countAllResults();
|
||||
return $q;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user