Skip to content

Commit

Permalink
Ordenar banco de dados Area cliente
Browse files Browse the repository at this point in the history
  • Loading branch information
cabralwms committed Dec 15, 2023
1 parent 7bfba13 commit 8c60e00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/models/Conecte_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getLastOs($cliente)
$this->db->from('os');
$this->db->join('usuarios', 'os.usuarios_id = usuarios.idUsuarios', 'left');
$this->db->where('clientes_id', $cliente);
$this->db->limit(5);
$this->db->limit(10);
$this->db->order_by('idOs', 'desc');

return $this->db->get()->result();
Expand All @@ -39,8 +39,9 @@ public function getLastCompras($cliente)
$this->db->select('vendas.*,usuarios.nome');
$this->db->from('vendas');
$this->db->join('usuarios', 'usuarios.idUsuarios = vendas.usuarios_id');
$this->db->order_by('idVendas', 'desc');
$this->db->where('clientes_id', $cliente);
$this->db->limit(5);
$this->db->limit(10);

return $this->db->get()->result();
}
Expand All @@ -51,6 +52,7 @@ public function getCompras($table, $fields, $where = '', $perpage = 0, $start =
$this->db->select($fields);
$this->db->from($table);
$this->db->join('usuarios', 'vendas.usuarios_id = usuarios.idUsuarios', 'left');
$this->db->order_by('idVendas', 'desc');
$this->db->where('clientes_id', $cliente);
$this->db->limit($perpage, $start);
if ($where) {
Expand All @@ -69,6 +71,7 @@ public function getCobrancas($table, $fields, $where = '', $perpage = 0, $start
$this->db->from($table);
$this->db->join('clientes', 'cobrancas.clientes_id = clientes.idClientes', 'left');
$this->db->where('clientes_id', $cliente);
$this->db->order_by('expire_at','desc');
$this->db->limit($perpage, $start);
if ($where) {
$this->db->where($where);
Expand Down

0 comments on commit 8c60e00

Please sign in to comment.