Commit c5a906d3 by Jansa Jose

book service changes

parent bfcf102c
...@@ -1465,6 +1465,7 @@ ...@@ -1465,6 +1465,7 @@
return; return;
} }
$data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"service_id\" : \"".$fcm_data['booking_id']."\", \"type\" : \"".$fcm_data['service_type']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['device_id']."\"}"; $data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"service_id\" : \"".$fcm_data['booking_id']."\", \"type\" : \"".$fcm_data['service_type']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['device_id']."\"}";
$ch = curl_init("https://fcm.googleapis.com/fcm/send"); $ch = curl_init("https://fcm.googleapis.com/fcm/send");
$header = array('Content-Type: application/json', 'Authorization: key='.$key); $header = array('Content-Type: application/json', 'Authorization: key='.$key);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
......
...@@ -363,7 +363,11 @@ class Webservice_model extends CI_Model { ...@@ -363,7 +363,11 @@ class Webservice_model extends CI_Model {
$this->db->join('mechanic','mechanic_booking.mechanic_id = mechanic.mechanic_id'); $this->db->join('mechanic','mechanic_booking.mechanic_id = mechanic.mechanic_id');
$this->db->join('admin_users','admin_users.id = mechanic.mechanic_id'); $this->db->join('admin_users','admin_users.id = mechanic.mechanic_id');
$this->db->join('mechanic_shop','mechanic_shop.shop_id = mechanic.shop_id','left'); $this->db->join('mechanic_shop','mechanic_shop.shop_id = mechanic.shop_id','left');
$this->db->group_by('bookings.booking_id');
$mech_data = $this->db->get_where('bookings',array('bookings.booking_id'=>$postData['booking_id'])); $mech_data = $this->db->get_where('bookings',array('bookings.booking_id'=>$postData['booking_id']));
// pr($this->db->last_query());
if(!empty($mech_data) && !empty($mechanic_data = $mech_data->row_array())){ if(!empty($mech_data) && !empty($mechanic_data = $mech_data->row_array())){
$this->db->insert('transaction',array('customer_id'=>$mechanic_data['customer_id'],'booking_id'=>$postData['booking_id'],'payment_for'=>'1','datetime'=>date('Y-m-d h:i:s'),'amount'=>$cost)); $this->db->insert('transaction',array('customer_id'=>$mechanic_data['customer_id'],'booking_id'=>$postData['booking_id'],'payment_for'=>'1','datetime'=>date('Y-m-d h:i:s'),'amount'=>$cost));
......
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