$this->db->join('customer AS CUST','CUST.id = USR.user_id');
//$this->db->join('customer AS CUST','CUST.cust_id = USR.profile_id');
$result=$this->db->get_where('users AS USR',array('CUST.email_id'=>$userLogData['user_email'],'USR.status'=>'1','USR.user_type'=>'1','USR.password'=>$userLogData['user_password']));
$result=$this->db->get_where('users AS USR',array('USR.username'=>$userLogData['user_email'],'USR.status'=>'1','USR.user_type'=>'1','USR.password'=>$userLogData['user_password']));
$respArr['message']="Invalid Password";
$respArr['message']="Invalid Password";
...
@@ -77,7 +77,7 @@ class Webservice_model extends CI_Model {
...
@@ -77,7 +77,7 @@ class Webservice_model extends CI_Model {
//$this->db->join('customer AS CUST','CUST.cust_id = USR.profile_id');
$emailChk=$this->db->get_where('users AS USR',array('USR.username'=>$postData['user_email'],'USR.status !='=>'2','USR.user_type'=>'1','USR.profile_id !='=>$postData['user_id']));
$sql=$this->db->query("SELECT count(PTS.id) AS count,PTS.id,PTS.unique_name,PTS.part_number FROM pos_parts AS PTS LEFT JOIN booking_parts AS BKPTS ON BKPTS.pos_part_id = PTS.id WHERE PTS.status='1' GROUP BY PTS.id ORDER BY count DESC");
$sql=$this->db->query("SELECT GRBK.booking_id,GRBK.booking_date,GROUP_CONCAT(SBSRVCE.sub_services SEPARATOR ', ') AS subservices FROM garage_booking AS GRBK LEFT JOIN sub_services AS SBSRVCE ON find_in_set(SBSRVCE.id,GRBK.subservices_ids) WHERE GRBK.cust_id=$userId AND GRBK.status=1");
$sql=$this->db->query("SELECT customer.*,users.username,users.password,users.phone_no FROM customer JOIN users ON (users.profile_id = customer.cust_id AND users.user_type=1) WHERE customer.cust_id =$userId");
$sql=$this->db->query("SELECT RDAST.road_assist_id,RDAST.road_assist_code,RDAST.name,RDAST.profile_photo,RDAST.phone_no,RDAST.email_id,RDAST.address FROM road_assist AS RDAST WHERE road_assist_id=$road_assist_id");
$sql=$this->db->query("SELECT CUST.name,CUST.cust_id,CUST.phone_no,RDBK.id AS roadservicerequestid,RDBK.lat,RDBK.lng,VM.make,VM.model FROM road_booking AS RDBK INNER JOIN customer AS CUST ON (CUST.cust_id = RDBK.cust_id) INNER JOIN vehicle_model AS VM ON (VM.id = RDBK.vehicle_id) WHERE RDBK.road_assist_id =$road_assist_id");
$sql=$this->db->query("SELECT CUST.name,RDBK.road_assist_id,CUST.phone_no,RDBK.id AS roadservicerequestid,RDBK.status,RDBK.date FROM road_booking AS RDBK INNER JOIN customer AS CUST ON (CUST.cust_id = RDBK.cust_id) WHERE RDBK.cust_id =$userId");