Last active
November 17, 2017 09:41
-
-
Save jagroop/37a06d4e837ea4d826754f87a91769e5 to your computer and use it in GitHub Desktop.
Cron jobs Logics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 3:30 AM Cron job | |
public function threeAMCron() | |
{ | |
$this->db->where_in('id', [14, 60]); | |
$this->db->where("date_format(CONVERT_TZ(NOW(), 'UTC', local_tz), '%H:%i') = '15:30'"); | |
$users = $this->db->get('users')->result(); | |
$this->load->library('notification'); | |
foreach ($users as $key => $user) { | |
$this->notification->send($user, [ | |
'from_id' => $user->id, | |
'message' => "2 PM Notification test, please take a screen shot.", | |
'type' => 'inactive_trackee' | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment