<?php
require_once APPPATH."core/My_Model.php";
//use application\core\My_Model;

//use application\models\MyModel;

//namespace application\models\hclinica;

class CuentaModel extends My_Model
{
    public function __construct()
    {
        parent::__construct();
        //$this->db=$this->conexion;
        $this->db=$this->conexion;
        $this->table="cuenta";
        $this->idTable="idCuenta";
    }
    public function guardarStdCuenta($objeto)
    {
        $this->guardarStdObject($objeto);
    }
    public function getListAdeudoCuenta($idPaciente)
    {
        $sql="SELECT * FROM {$this->table} WHERE idPaciente=? AND saldo>? AND situacion<>? AND status=?";
        return $this->getListRowsAssoc($sql,[$idPaciente,0,"CANCELADO",1]);
    }
    public function getListCuentaByKeys($ids)
    {
        $sql="SELECT * FROM {$this->table} WHERE idCuenta IN($ids)";
        return $this->getListRowsAssoc($sql,[$ids],true);
    }
}
