Commit 9bc3bfd7 by Tobin

dc

parent cc6250fa
...@@ -31,8 +31,9 @@ class Webservice_model extends CI_Model { ...@@ -31,8 +31,9 @@ class Webservice_model extends CI_Model {
function login($data){ function login($data){
try{ try{
$sql = "SELECT region.id AS city_id, customer.name AS user_name,customer.phone, customer.email, $sql = "SELECT region.id AS city_id, customer.name AS user_name,customer.phone, customer.email,
customer.profile_image AS profile_photo, IF(customer.phone_verified=0,'false', 'true') AS is_phone_verified, IF(customer.city='', 'false', 'true') AS is_location_updated, customer.profile_image AS profile_photo,customer.profile_image_qr,
users.id AS user_id IF(customer.phone_verified=0,'false', 'true') AS is_phone_verified,
IF(customer.city='', 'false', 'true') AS is_location_updated,users.id AS user_id
FROM users FROM users
INNER JOIN customer ON (customer.customer_id=users.id) INNER JOIN customer ON (customer.customer_id=users.id)
LEFT JOIN region ON (region.id=customer.city) LEFT JOIN region ON (region.id=customer.city)
...@@ -64,6 +65,7 @@ class Webservice_model extends CI_Model { ...@@ -64,6 +65,7 @@ class Webservice_model extends CI_Model {
'phone'=>$result->phone, 'phone'=>$result->phone,
'email'=>$result->email, 'email'=>$result->email,
'profile_photo'=>$result->profile_photo, 'profile_photo'=>$result->profile_photo,
'profile_image_qr'=>$result->profile_image_qr,
'user_id'=>$result->user_id, 'user_id'=>$result->user_id,
'is_phone_verified'=>$result->is_phone_verified === 'true'? true: false, 'is_phone_verified'=>$result->is_phone_verified === 'true'? true: false,
'is_location_updated'=>$result->is_location_updated === 'true'? true: false, 'is_location_updated'=>$result->is_location_updated === 'true'? true: false,
...@@ -179,7 +181,7 @@ class Webservice_model extends CI_Model { ...@@ -179,7 +181,7 @@ class Webservice_model extends CI_Model {
array($email),$template['registration_sms']); array($email),$template['registration_sms']);
} }
$this->sendSMS($data['phone'],$message); $this->sendSMS($data['phone'],$message);
$this->db->select("customer.name AS user_name,customer.phone,customer.email,customer.profile_image AS profile_photo,users.id AS user_id, IF(customer.phone_verified = 0,'false','true') AS is_phone_verified"); $this->db->select("customer.name AS user_name,customer.phone,customer.email,customer.profile_image AS profile_photo,customer.profile_image_qr,users.id AS user_id, IF(customer.phone_verified = 0,'false','true') AS is_phone_verified");
$this->db->where('users.id',$id); $this->db->where('users.id',$id);
$this->db->from('users'); $this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id'); $this->db->join('customer','customer.customer_id = users.id');
...@@ -193,6 +195,7 @@ class Webservice_model extends CI_Model { ...@@ -193,6 +195,7 @@ class Webservice_model extends CI_Model {
'phone'=>$result->phone, 'phone'=>$result->phone,
'email'=>$result->email, 'email'=>$result->email,
'profile_photo'=>$result->profile_photo, 'profile_photo'=>$result->profile_photo,
'profile_image_qr'=>$result->profile_image_qr,
'is_phone_verified'=>$result->is_phone_verified === 'true'? true: false 'is_phone_verified'=>$result->is_phone_verified === 'true'? true: false
); );
$response = array('user'=>$resultArray,'auth_token'=>$auth_token); $response = array('user'=>$resultArray,'auth_token'=>$auth_token);
...@@ -222,7 +225,7 @@ class Webservice_model extends CI_Model { ...@@ -222,7 +225,7 @@ class Webservice_model extends CI_Model {
$settingsDetails = $this->db->query($sql)->row_array(); $settingsDetails = $this->db->query($sql)->row_array();
$settingsDetails['contact_number'] = $settings['contact_number']; $settingsDetails['contact_number'] = $settings['contact_number'];
$userDetails = $this->db->query("SELECT customer.name AS name, customer.profile_image AS profile_photo,customer.gender AS gender, customer.email, customer.dob, customer.profile_city AS city_name, users.notification_status, users.email_status FROM customer INNER JOIN users ON users.id = customer.customer_id WHERE customer.customer_id = ".$user_id." AND users.status = 1 ")->row_array(); $userDetails = $this->db->query("SELECT customer.name AS name, customer.profile_image AS profile_photo,customer.profile_image_qr,customer.gender AS gender, customer.email, customer.dob, customer.profile_city AS city_name, users.notification_status, users.email_status FROM customer INNER JOIN users ON users.id = customer.customer_id WHERE customer.customer_id = ".$user_id." AND users.status = 1 ")->row_array();
if(count($settingsDetails)>0 && count($userDetails)){ if(count($settingsDetails)>0 && count($userDetails)){
$resultData = array(); $resultData = array();
$resultData = array_merge($settingsDetails, $userDetails); $resultData = array_merge($settingsDetails, $userDetails);
...@@ -841,12 +844,13 @@ class Webservice_model extends CI_Model { ...@@ -841,12 +844,13 @@ class Webservice_model extends CI_Model {
$settingsDetails = $this->db->query($sql)->row_array(); $settingsDetails = $this->db->query($sql)->row_array();
$settingsDetails['contact_number'] = $settings['contact_number']; $settingsDetails['contact_number'] = $settings['contact_number'];
$sql = "SELECT booking.qrcode,events.event_id,events.venue_id, $sql = "SELECT booking.qrcode,events.event_id,events.venue_id,event_date_time.date,
events.has_payment AS is_payment_required,event_date_time.date, events.has_payment AS is_payment_required,booking.bookId AS ticket_id,
event_gallery.media_url AS event_image,booking.bookId AS ticket_id, event_gallery.media_url AS event_image,booking.amount AS total_rate,
event_date_time.time,venue.location_lat AS latitude,venue.location_lng AS longitude, event_date_time.time,venue.location AS address,customer.name AS profile_name,
venue.location AS address,booking.amount AS total_rate,customer.name AS profile_name, venue.location_lng AS longitude,venue.location_lat AS latitude,
booking.no_of_ticket AS ticket_count,customer.profile_image AS profile_photo booking.no_of_ticket AS ticket_count,customer.profile_image AS profile_photo,
customer.profile_image_qr
FROM events FROM events
LEFT JOIN event_gallery ON events.event_id=event_gallery.event_id AND LEFT JOIN event_gallery ON events.event_id=event_gallery.event_id AND
event_gallery.media_type=0 event_gallery.media_type=0
...@@ -1014,7 +1018,7 @@ class Webservice_model extends CI_Model { ...@@ -1014,7 +1018,7 @@ class Webservice_model extends CI_Model {
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.gender, $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.gender,
customer.profile_image AS image,users.id AS userId, customer.city, customer.profile_image AS image,users.id AS userId, customer.city,
customer.profile_image_qr AS customer_qr'); customer.profile_image_qr');
$this->db->where('users.id',$user_id); $this->db->where('users.id',$user_id);
$this->db->from('users'); $this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id'); $this->db->join('customer','customer.customer_id = users.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