mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
messages departments section
This commit is contained in:
@ -108,7 +108,7 @@ class ChatDeparmentModel extends Model
|
||||
|
||||
public function getChatDeparmentUserQuery(int $chat_deparment_id)
|
||||
{
|
||||
$query = $this->builder()
|
||||
$query = $this
|
||||
->select(
|
||||
[
|
||||
"users.*"
|
||||
@ -123,20 +123,21 @@ class ChatDeparmentModel extends Model
|
||||
"users",
|
||||
"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);
|
||||
)
|
||||
->where("chat_department_users.chat_department_id", $chat_deparment_id)
|
||||
->where("chat_department_users.deleted_at",null)
|
||||
->where("users.deleted_at",null);
|
||||
return $query;
|
||||
}
|
||||
public function getChatDepartmentUsers(int $chat_deparment_id)
|
||||
{
|
||||
$result = $this->getChatDeparmentUserQuery($chat_deparment_id)
|
||||
->where('chat_department_users.presupuesto_id', null)
|
||||
->where('chat_department_users.pedido_id', null)
|
||||
->where('chat_department_users.factura_id', null)
|
||||
->get()->getResultObject();
|
||||
return $result;
|
||||
->where('chat_department_users.presupuesto_id',null)
|
||||
->where('chat_department_users.pedido_id',null)
|
||||
->where('chat_department_users.factura_id',null)
|
||||
->get();
|
||||
|
||||
return $result->getResultObject() ?: [];
|
||||
}
|
||||
public function getChatDeparmentPresupuestoUsers(int $chat_deparment_id, int $presupuesto_id)
|
||||
{
|
||||
@ -163,7 +164,7 @@ class ChatDeparmentModel extends Model
|
||||
{
|
||||
return $this->find($chat_deparment_id)->display;
|
||||
}
|
||||
public function getChatDepartmentSelect(string $query = null)
|
||||
public function getChatDepartmentSelect(?string $query)
|
||||
{
|
||||
$q = $this->builder()->select([
|
||||
"id",
|
||||
@ -176,4 +177,8 @@ class ChatDeparmentModel extends Model
|
||||
}
|
||||
return $q;
|
||||
}
|
||||
public function datatableQuery()
|
||||
{
|
||||
return $this->select(['id','display','description'])->where('deleted_at',null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user