本文整理匯總了PHP中cron::move方法的典型用法代碼示例。如果您正苦於以下問題:PHP cron::move方法的具體用法?PHP cron::move怎麽用?PHP cron::move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cron
的用法示例。
在下文中一共展示了cron::move方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* cron constructor
*/
public function __construct()
{
// Mail center
$date = JFactory::getDate();
$today = time();
$day = date('D', $today);
$time = date('H:i', $today);
if (DISCOUNT_MAIL_SEND) {
cron::after_purchased_order_mail();
}
// Move Container to Stockroom start
$fdate = date('Y-m-d', $today);
$db = JFactory::getDbo();
// Calculation for move Container once in day
$query = "SELECT count(id) FROM #__" . TABLE_PREFIX . "_cron WHERE date = " . $db->quote($fdate);
$db->setQuery($query);
$data = $db->loadResult();
if ($data != 1) {
// Default $data != 1
$q_update = "UPDATE #__" . TABLE_PREFIX . "_cron SET date = " . $db->quote($fdate) . " WHERE id = 1";
$db->setQuery($q_update);
$db->query();
if (SEND_CATALOG_REMINDER_MAIL) {
cron::catalog_mail();
}
cron::color_mail();
// Send subscription renewal mail.
cron::subscription_renewal_mail();
// End mail center
if (USE_CONTAINER) {
$query = "SELECT * FROM #__" . TABLE_PREFIX . "_container";
$db->setQuery($query);
$data = $db->loadObjectList();
foreach ($data as $cont_data) {
$date_diff = $today - $cont_data->creation_date;
$diff_day = $date_diff / (60 * 60 * 24);
// Calculation of Days For moving
$remain_day = $cont_data->max_del_time * 7 - floor($diff_day);
if ($remain_day >= 0 && $remain_day <= 7) {
$container_id = $cont_data->container_id;
$stockroom_id = $cont_data->stockroom_id;
// Move Container into stockroom
$move = cron::move($container_id, $stockroom_id);
if ($move) {
// Call Order Status Change
cron::order_status($container_id);
}
}
}
}
}
}