fix datatable messages

This commit is contained in:
amazuecos
2025-02-26 08:11:12 +01:00
parent c5f1f0e55a
commit ae561d1e19
8 changed files with 184 additions and 43 deletions

View File

@ -11,7 +11,7 @@ class ChatDeparmentModel extends Model
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $useSoftDeletes = true;
protected $protectFields = true;
protected $allowedFields = [
"name",
@ -107,7 +107,7 @@ class ChatDeparmentModel extends Model
}
public function getChatDepartmentUsers(int $chat_deparment_id)
{
$result = $this->db->table('chat_departments')
$result = $this->builder()
->select(
[
"users.*"
@ -123,6 +123,8 @@ class ChatDeparmentModel extends Model
"chat_department_users.user_id = users.id",
'left'
)->where("chat_departments.id", $chat_deparment_id)
->where("chat_department_users.deleted_at",null)
->where("users.deleted_at",null)
->get()->getResultObject();
return $result;
}