backoffice/application/models/Nano_health_model.php

38 lines
1.1 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: capp
* Date: 29/05/2018
* Time: 15:49
*/
class Nano_health_model extends CI_Model
{
public function createConfig($id_network){
$this->db->query("INSERT INTO nh_networks_configs (network_id) VALUES ($id_network)");
return $this->db->insert_id();
}
public function getAllInsurances($id_network)
{
$query = $this->db->query("SELECT * FROM nh_insurances WHERE network_id = $id_network");
return $query->num_rows() > 0 ? $query : false ;
}
// Nano sante
public function getAllIlinkWorldNetworks()
{
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,cc.name AS country,networks.country_id , configWallet.id_network , configWallet.type,cc.currency_code,
configWallet.has_nano_health FROM `networks`
INNER JOIN countries_currencies cc ON networks.country_id=cc.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1 AND configWallet.type = 'ilink'");
if ($query->num_rows() > 0) {
return $query;
} else {
return false;
}
}
}