Commit cfa05614 by Adarsh K

Merge branch 'adarsh' into 'master'

Adarsh See merge request !2
parents 38a6c150 eb3605ba
......@@ -27,7 +27,7 @@ class Handle_model extends CI_Model {
}
function registration($data) {
$dup = $this->db->query("SELECT customer.email_id, customer.phone_no FROM `users` LEFT JOIN customer ON users.user_type = customer.user_type WHERE (users.username = '".$data['email_id']."' OR customer.phone_no = '".$data['phone_no']."')");
$dup = $this->db->query("SELECT customer.email_id, customer.phone_no FROM `users` LEFT JOIN customer ON users.user_type = customer.user_type WHERE (users.username = '".$data['email_id']."' OR customer.phone_no = '".$data['phone_no']."') GROUP BY customer.id");
if($dup->num_rows() > 0) {
if($dup->num_rows() > 1) {
$res = array('status'=> 0,'message'=>'Email and Phone are already exists','code'=>'009');
......@@ -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