require_once SCRIPT_PATH . "framework.php"; Core::getInstance(); $res = ""; $carrierId = 0; $data = array(); $carrierId = isset($argv[1]) ? abs(intval($argv[1])) : 0; //运输方式ID $days = isset($argv[2]) ? abs(intval($argv[2])) : 1; //几天内跟踪号,不填默认1天内 if (empty($carrierId)) { exit("运输方式名填写有误"); } if (!is_numeric($days)) { exit("天数只能为数字"); } $res = TransOpenApiModel::getOrderTrackNumList($carrierId, $days); echo $res, "\n\n"; $res = json_decode($res, true); if (!is_array($res['data']) || !count($res['data'])) { print_r($argv); exit("没有数据被获取,请确认条件!"); } $res = $res['data']; foreach ($res as $v) { $timestr = date('Y-m-d h:i:s', time()); $v['ebay_tracknumber'] = str_replace(array('CNEE', 'CNRB', 'SGEM'), array('CN,EE', 'CN,RB', 'SG,EM'), $v['ebay_tracknumber']); $numArr = preg_split("/[\\|和,\\s]+/", $v['ebay_tracknumber']); foreach ($numArr as $val) { $flag = TransOpenApiModel::checkTrackNumber($val, $carrierId); if (!$flag) { if (empty($val)) {