Commit 453df0d0 by Jansa Jose

dc

parent e1acc674
...@@ -1458,9 +1458,9 @@ ...@@ -1458,9 +1458,9 @@
return; return;
} }
// $data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"booking_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']."\"}";
$data = "{\"data\":{\"params\":{\"service_id\":\"".$fcm_data['booking_id']."\"},\"type\":\"".$fcm_data['service_type']."\"},\"to\":\"".$fcm_data['device_id']."\"}"; // $data = "{\"data\":{\"params\":{\"service_id\":\"".$fcm_data['booking_id']."\"},\"type\":\"".$fcm_data['service_type']."\"},\"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);
......
...@@ -113,6 +113,9 @@ class Booking_model extends CI_Model { ...@@ -113,6 +113,9 @@ class Booking_model extends CI_Model {
$bookDetails = array(); $bookDetails = array();
$bookData = $bookData->result(); $bookData = $bookData->result();
foreach($bookData AS $book) { foreach($bookData AS $book) {
if(empty($book->scheduled_date) || empty($book->scheduled_time)){
continue;
}
$bookMechData=$this->db->query("SELECT * FROM mechanic_booking $bookMechData=$this->db->query("SELECT * FROM mechanic_booking
WHERE booking_id='$book->booking_id' AND status!='2'"); WHERE booking_id='$book->booking_id' AND status!='2'");
if(!empty($bookMechData)){ if(!empty($bookMechData)){
......
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