load->library('session'); $this->load->_model('Model_api','api'); $this->load->_model('Model_shop','shop'); $this->load->_model('Model_fullorder','fullorder'); $this->load->_model('Model_fullordertt','fullordertt'); $this->load->_model('Model_fullordersmt','fullordersmt'); $this->load->_model('Model_country','country'); $this->load->_model('Model_hl','hl'); $this->load->_model('Model_is','is'); $this->load->_model('Model_kdniao','kdniao'); $this->load->_model('Model_typeclass','typeclass'); $this->load->_model('Model_warehouse','warehouse'); $this->load->_model('Model_fullorderexcel','fullorderexcel'); $this->load->_model('Model_dhl','dhl'); $this->load->_model('Model_usps','usps'); $this->load->_model('Model_ups','ups'); $this->load->_model('Model_dhltest','dhltest'); $this->load->_model('Model_customer','customer'); $this->load->_model('Model_express','express'); $this->load->_model('Model_notice','notice'); $this->load->_model('Model_emaildata','emaildata'); $this->load->_model('Model_whlabel','whlabel'); $this->load->_model('Model_productdescribe','productdescribe'); $this->load->_model('Model_ljg','ljg'); $this->load->_model('Model_commodityread','commodityread'); $this->load->_model('Model_service','service'); $this->load->_model('Model_fedex','fedex'); $this->load->_model('Model_apismt','apismt'); $this->load->_model('Model_cne','cne'); $this->load->_model('Model_specialstock','specialstock'); $this->load->_model('Model_whlabellabel','whlabellabel'); $this->load->_model('Model_allocation','allocation'); $this->load->_model('Model_yswaybill','yswaybill'); $this->load->_model('Model_paypal','paypal'); $this->load->_model('Model_17track','17track'); $this->load->_model('Model_ck','ck'); $this->load->_model('Model_weight','weight'); $this->load->_model('Model_pay','pay'); $this->load->_model('Model_setting','setting'); $this->load->_model('Model_classid','classid'); $this->load->_model('Model_apitt','apitt'); $this->load->_model('Model_customertt','customertt'); $this->load->_model('Model_als','als'); $this->load->_model('Model_apiyy','apiyy'); $this->load->_model('Model_whlabel_fc','whlabel_fc'); $this->load->_model('Model_excel','excel'); } //定义方法的调用规则 获取URI第二段值 public function _remap($arg,$arg_array) { if($arg == 'c') { $this->_c(); } else if($arg == 'excel') { $this->_excel($arg_array); } else if($arg == 'rz') { $this->_rz($arg_array); } } public function _excel($arg_array) { $filePath = './data/yyexcel/'.$arg_array[0].'/excel.txt'; $fileContent = file_get_contents($filePath); if ($fileContent !== false) { header( 'Content-Type: application/vnd.ms-excel; name=excel' ); header( 'Content-type: application/octet-stream' ); header( 'Content-Disposition: attachment; filename='.$arg_array[0].'.xls'); header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ); header( 'Pragma: no-cache' ); header( 'Expires: 0' ); echo $fileContent; } else { echo "文件无法读取"; } } public function _rz($arg_array) { $a = './data/yylog/RK-'.$arg_array[0].'.txt'; if(is_file($a)) { $myfile = fopen($a, "r") or die("Unable to open file!"); $bc = fread($myfile,filesize($a)); fclose($myfile); $zt = explode('\n',trim($bc,'\n')); //$bc = json_decode($bc,true); $nr = array(); foreach($zt as $k=>$val) { $xx = explode(' = ',trim($val,' = ')); if(stripos($xx[0],'RK-F') !== false) { $nr[$k][][0] = '入库发送'; } else if(stripos($xx[0],'RK-J') !== false) { $nr[$k][][0] = '入库接收'; } else if(stripos($xx[0],'SH-F') !== false) { $nr[$k][][0] = '审核发送'; } else if(stripos($xx[0],'SH-J') !== false) { $nr[$k][][0] = '审核接收'; } else if(stripos($xx[0],'DC-F') !== false) { $nr[$k][][0] = '调出发送'; } else if(stripos($xx[0],'DC-J') !== false) { $nr[$k][][0] = '调出接收'; } $nr[$k][][1] = $xx[1]; } echo "
";
print_r($nr);
}
else
{
echo '无';
}
}
public function _c()
{
$asd = array();
$f = array('fullordersmt','fullordertt','fullorder');
foreach($f as $v)
{
$d = $this->$v->find_all("librarytime > '".(time()-(5*24*3600))."' and (type = '13' or type = '16') and dbapi < 99");
if($d)
{
$h = $this->_list($d,$v);
foreach($h as $vv)
{
$x = 0;$c = 0;
$xs = $this->apiyy->_cxxsdd($vv['0']);
$chd = $this->apiyy->_cxchd($vv['0']);
if(isset($xs['Data'][0]))
{
$vv[] = '成功';
$x = 1;
}
else
{
$vv[] = '无';
}
if(isset($chd['Data'][0]))
{
$vv[] = '成功';
$c = 1;
}
else
{
$vv[] = '无';
}
if($x==1 && $c==1)
{
$this->$v->save(array('dbapi'=>99),$vv[4]);
}
$asd[] = $vv;
}
}
}
$title = "表 ".date("Y-m-d");
$titlename = "".$title." | ||||||
|---|---|---|---|---|---|---|
| 编号 | 销售订单发送 | 销售订单接收 | 出货单发送 | 出货单接收 | 销售订单验证 | 出货单验证 |