本文整理匯總了PHP中cron::model方法的典型用法代碼示例。如果您正苦於以下問題:PHP cron::model方法的具體用法?PHP cron::model怎麽用?PHP cron::model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cron
的用法示例。
在下文中一共展示了cron::model方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
<?php
$row = cron::model()->fetch(array("select" => "`lastrun`,`nextrun`", "condition" => "filename = :filename", "params" => array(":filename" => basename(__FILE__))));
$clist = Calendars::model()->listCalendarByRange($row["lastrun"], $row["nextrun"] + 86400 * 3);
foreach ($clist["events"] as $calendar) {
if ($calendar["isalldayevent"] == 1) {
$start_date = date("Y-m-d", $calendar["starttime"]);
$remind_date_min = $start_date . " 07:59:00";
$remind_date_max = $start_date . " 10:01:00";
$remind_time_min = strtotime($remind_date_min);
$remind_time_max = strtotime($remind_date_max);
if ($remind_time_min < time() && time() < $remind_time_max) {
$stime = date("m-d", $calendar["starttime"]);
$title = $stime . "全天日程";
$subject = StringUtil::cutStr($calendar["subject"], 20);
$config = array("{subject}" => $subject, "{url}" => Ibos::app()->urlManager->createUrl("calendar/schedule/index"));
Notify::model()->sendNotify($calendar["uid"], "calendar_message", $config);
}
} elseif ($calendar["starttime"] <= $row["nextrun"]) {
$stime = date("m-d H:i", $calendar["starttime"]);
$etime = date("m-d H:i", $calendar["endtime"]);
$title = $stime . " 至 " . $etime . "日程";
$subject = StringUtil::cutStr($calendar["subject"], 20);
$config = array("{subject}" => $subject, "{url}" => Ibos::app()->urlManager->createUrl("calendar/schedule/index"));
Notify::model()->sendNotify($calendar["uid"], "calendar_message", $config);
}
}