本文整理汇总了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);
}
}
}
}
}
}