Commit eb3605ba by Adarsh K

model change

parent 516098b9
......@@ -66,7 +66,7 @@ class Handle_model extends CI_Model {
}
function categories($data) {
if($data['cat_id']) {
if(isset($data['cat_id'])) {
$this->db->where('id',$data['cat_id']);
}
$data_rs = $this->db->select('id,cat_name,cat_image')->where('status', 1)->get('category');
......@@ -84,10 +84,10 @@ class Handle_model extends CI_Model {
}
function sub_categories($data) {
if($data['cat_id']) {
if(isset($data['cat_id'])) {
$this->db->where('cat_id',$data['cat_id']);
}
if($data['id']) {
if(isset($data['id'])) {
$this->db->where('id',$data['id']);
}
$data_rs = $this->db->select('id,sub_cat_name,sub_cat_image')->where('status', 1)->get('sub_category');
......
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