Commit f347ae2a by Trần Văn Minh

chỉnh sửa add user

parent 1373a75f
...@@ -1826,7 +1826,7 @@ class Crud_model extends CI_Model { ...@@ -1826,7 +1826,7 @@ class Crud_model extends CI_Model {
} }
public function get_organization_all($param1 = "", $is_supper_admin = "") { public function get_organization_all($param1 = "", $is_supper_admin = "") {
if($is_supper_admin == 0) { if($is_supper_admin == 0 && $param1 != "") {
if ($param1 != "" && $param1 != array()) { if ($param1 != "" && $param1 != array()) {
$this->db->where_in('id', $param1); $this->db->where_in('id', $param1);
} else { } else {
...@@ -1834,9 +1834,15 @@ class Crud_model extends CI_Model { ...@@ -1834,9 +1834,15 @@ class Crud_model extends CI_Model {
$this->db->where('id', $organization_id); $this->db->where('id', $organization_id);
} }
return $this->db->get('organization'); return $this->db->get('organization');
} else } else if ($is_supper_admin === 1) {
return $this->db->get('organization'); return $this->db->get('organization');
} }
if ($param1 == "" && $is_supper_admin == "") {
$where = "parent_id != 0";
$this->db->where($where);
return $this->db->get('organization');
}
}
public function get_organ_details_by_id($id) { public function get_organ_details_by_id($id) {
return $this->db->get_where('organization', array('id' => $id)); return $this->db->get_where('organization', array('id' => $id));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment