first commit
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php if (!defined('BASEPATH')) {
|
||||
exit('No direct script access allowed');
|
||||
}
|
||||
|
||||
class Acl_Whitelist_Extra_model extends CI_Model {
|
||||
|
||||
private $read_replica;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->read_replica = $this->load->database('savvy_replica', TRUE);
|
||||
}
|
||||
|
||||
public function getRecordAclWhiteListExtraByParamNameAndParamValueAndAclWhiteListID($data) {
|
||||
$this->read_replica->select('id');
|
||||
$this->read_replica->from('bko_acl_whitelist_extra');
|
||||
$this->read_replica->where('bko_acl_whitelist_id', $data['bko_acl_whitelist_id']);
|
||||
$this->read_replica->where('parameter_name', $data['parameter_name']);
|
||||
$this->read_replica->where('parameter_value', $data['parameter_value']);
|
||||
|
||||
return $this->read_replica->get()->num_rows();
|
||||
}
|
||||
|
||||
public function insertAclWhitelistExtra($data) {
|
||||
|
||||
$this->db->insert('bko_acl_whitelist_extra', $data);
|
||||
return $this->db->insert_id();
|
||||
|
||||
}
|
||||
|
||||
public function getRecordAclWhitelistExtraByID($data) {
|
||||
return $this->read_replica->get_where('bko_acl_whitelist_extra', $data)->num_rows();
|
||||
}
|
||||
|
||||
public function updateAclWhitelistExtra($data) {
|
||||
$this->db->set('parameter_name', $data['parameter_name']);
|
||||
$this->db->set('parameter_value', $data['parameter_value']);
|
||||
$this->db->where('id', $data['id']);
|
||||
$this->db->update('bko_acl_whitelist_extra');
|
||||
|
||||
return $this->db->affected_rows();
|
||||
}
|
||||
|
||||
public function deleteAclWhitelistExtra($id) {
|
||||
|
||||
$this->db->where('id', $id);
|
||||
$this->db->delete('bko_acl_whitelist_extra');
|
||||
|
||||
return $this->db->affected_rows();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user