Commit 5481f172 by Tobin

dc

parent 82d55c37
...@@ -52,11 +52,13 @@ class Api_model extends CI_Model { ...@@ -52,11 +52,13 @@ class Api_model extends CI_Model {
if(count($res_count) > 0) { if(count($res_count) > 0) {
if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){ if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){
$res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12'); return array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12');
} else if($res_count->email == $data['email_id']){ } else if($res_count->email == $data['email_id']){
$res = array('status'=>0,'message'=>'Email id already exists','code'=>'ER09'); return array('status'=>0,'message'=>'Email id already exists','code'=>'ER09');
} else if(strpos($res_count->phone,$data['phone']) !== false) { } else if(strpos($res_count->phone,$data['phone'])!==false||$res_count->phone==$data['phone']){
$res = array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10'); return array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10');
}else{
return array('status'=>0,'message'=>'Something went wrong','code'=>'ER07');
} }
} else { } else {
$unique_id = uniqid().time(); $unique_id = uniqid().time();
...@@ -98,7 +100,7 @@ class Api_model extends CI_Model { ...@@ -98,7 +100,7 @@ class Api_model extends CI_Model {
$this->send_mail($subject,$email_id,$message); $this->send_mail($subject,$email_id,$message);
$res = array('status'=>1,'data'=>''); return array('status'=>1,'data'=>'');
// $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); // $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city');
// $this->db->where('users.id',$id); // $this->db->where('users.id',$id);
...@@ -114,13 +116,12 @@ class Api_model extends CI_Model { ...@@ -114,13 +116,12 @@ class Api_model extends CI_Model {
// $res = array('status'=>0,'message'=>'No record found','code'=>'ER13'); // $res = array('status'=>0,'message'=>'No record found','code'=>'ER13');
// } // }
} else { } else {
$res = array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11'); return array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11');
} }
} }
} catch(Exception $e) { } catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); return array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
} }
return $res;
} }
function send_mail($subject,$email,$message,$attach=null) { function send_mail($subject,$email,$message,$attach=null) {
......
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