mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
chat select cliente contactos
This commit is contained in:
@ -210,7 +210,6 @@ class ChatController extends BaseController
|
||||
}
|
||||
public function store_message($model)
|
||||
{
|
||||
|
||||
$data = $this->request->getPost();
|
||||
$chatMessageEntity = $this->chatService->storeChatMessage($data["chat_department_id"],$model,$data["model_id"],$data);
|
||||
return $this->response->setJSON($chatMessageEntity);
|
||||
@ -338,67 +337,25 @@ class ChatController extends BaseController
|
||||
{
|
||||
$pm = model(PresupuestoModel::class);
|
||||
$p = $pm->find($presupuesto_id);
|
||||
$query = $this->userModel->builder()->select(
|
||||
[
|
||||
"id",
|
||||
"CONCAT(first_name,' ',last_name,'(',username,')') as name"
|
||||
]
|
||||
)
|
||||
->where("deleted_at", null)
|
||||
->whereNotIn("id", [auth()->user()->id])
|
||||
->where("cliente_id", $p->cliente_id);
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("users.username", $this->request->getGet("q"))
|
||||
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
$cm = model(ClienteModel::class);
|
||||
$clienteContactos = $cm->querySelectClienteContacto($p->cliente_id,$this->request->getGet('q'));
|
||||
return $this->response->setJSON($clienteContactos);
|
||||
}
|
||||
public function get_pedido_client_users(int $pedido_id)
|
||||
{
|
||||
$pm = model(PedidoModel::class);
|
||||
$p = $pm->find($pedido_id);
|
||||
$query = $this->userModel->builder()->select(
|
||||
[
|
||||
"id",
|
||||
"CONCAT(first_name,' ',last_name,'(',username,')') as name"
|
||||
]
|
||||
)
|
||||
->where("deleted_at", null)
|
||||
->whereNotIn("id", [auth()->user()->id])
|
||||
->where("cliente_id", $p->cliente()->id);
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("users.username", $this->request->getGet("q"))
|
||||
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
$cm = model(ClienteModel::class);
|
||||
$clienteContactos = $cm->querySelectClienteContacto($p->cliente()->id,$this->request->getGet('q'));
|
||||
return $this->response->setJSON($clienteContactos);
|
||||
}
|
||||
public function get_factura_client_users(int $factura_id)
|
||||
{
|
||||
$fm = model(FacturaModel::class);
|
||||
$f = $fm->find($factura_id);
|
||||
$query = $this->userModel->builder()->select(
|
||||
[
|
||||
"id",
|
||||
"CONCAT(first_name,' ',last_name,'(',username,')') as name"
|
||||
]
|
||||
)
|
||||
->where("deleted_at", null)
|
||||
->whereNotIn("id", [auth()->user()->id])
|
||||
->where("cliente_id", $f->cliente_id);
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("users.username", $this->request->getGet("q"))
|
||||
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
$cm = model(ClienteModel::class);
|
||||
$clienteContactos = $cm->querySelectClienteContacto($f->cliente_id,$this->request->getGet('q'));
|
||||
return $this->response->setJSON($clienteContactos);
|
||||
}
|
||||
public function store_hebra(string $model)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user