Server : Apache
System : Linux iZ2vcgyutqttsd1p850kl8Z 3.10.0-1160.92.1.el7.x86_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 5.6.40
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/saimikebio.com/includes/modules/cron/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/saimikebio.com/includes/modules/cron/order_confirm.php
<?php
if (!defined('IN_ECS')){  
    die('Hacking attempt');  
}  
require_once(ROOT_PATH . 'includes/lib_common.php');
require_once(ROOT_PATH . 'includes/lib_order.php');
$cron_lang = ROOT_PATH . 'languages/' .$GLOBALS['_CFG']['lang']. '/cron/order_confirm.php';
if (file_exists($cron_lang)) {
    global $_LANG;
    include_once($cron_lang);
}

/* 模块的基本信息 */
if (isset($set_modules) && $set_modules == TRUE) {
    $i = isset($modules) ? count($modules) : 0;
    /* 代码 */
    $modules[$i]['code']    = basename(__FILE__, '.php');
    /* 描述对应的语言项 */
    $modules[$i]['desc']    = 'order_confirm_desc';
    /* 插件的作者 */
    $modules[$i]['author']  = '网络';
    /* 插件作者的官方网站 */
    $modules[$i]['website'] = 'http://www.ecshopjcw.com';
    /* 版本号 */
    $modules[$i]['version'] = '1.0.0';
    /* 配置信息 */
    $modules[$i]['config']  = array(
    );
    return;
}

//下面是这个计划任务要执行的程序了
$time  = gmtime();
$out_time = $GLOBALS['_CFG']['okgoods_time']*24*3600;

$sql="select * from ".$ecs->table('order_info')." where shipping_time < ($time-$out_time) and shipping_status=1";
$order=$db->getAll($sql);

foreach($order as $o){
  $is_back_now = 0;
  $is_back_now = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('back_order') . " WHERE order_id = " . $o['order_id'] . " AND status_back < 6 AND status_back != 3");
  if($is_back_now == 0)
  {
    /* 标记订单为已收货 */  
    $update_status = update_order($o['order_id'], array('shipping_status' => SS_RECEIVED));
  }
  
  /* 记录log */  
  $action_note = "计划任务:定期自动确定收货,订单号:".$o['order_sn'].",执行状态:".($update_status ? '成功' : '失败');  
  order_action($o['order_sn'], OS_CONFIRMED, SS_RECEIVED, PS_PAYED, $action_note, '系统');
  
}

?>