$soapclient = new soapclient($wsdl); //ebay账户的eub线上申请跟踪号,1为ebay平台,14为海外仓发货 $where = ' AND a.platformId in(1,14) AND a.transportId = 6'; $shipOrders = WhWaveOrderTransportModel::getOrderTransportRecords($limit, 1, $where); if (!$shipOrders) { echo "没有待申请的信息记录\n"; exit; } //批量获取订单详细信息 $orderids = array(); foreach ($shipOrders as $orderinfo) { $orderids[] = WhShippingOrderRelationModel::get_orderId($orderinfo['id']); } $orderisStr = implode("','", $orderids); //调用订单系统接口批量获取订单信息 $orders = CommonModel::get_orderInfoFromOrderSys($orderisStr); $orders = $orders['data']; if (empty($orders)) { exit('未获取申请跟踪号的订单详细信息'); } foreach ($shipOrders as $orderinfo) { $shipOrderId = $orderinfo['id']; $ebay_platformId = $orderinfo['platformId']; //平台名称 $orderId = WhShippingOrderRelationModel::get_orderId($shipOrderId); if (!in_array($ebay_platformId, array(1, 14))) { echo $ebay_account . "非EBAY账号!\n"; continue; } $ebay_username = $orderinfo['username']; $ebay_usermail = $orderinfo['email'];
public function printTaobao($orderInfo, $type) { // if($type==15){ foreach ($orderInfo as &$info) { //抓取地址中的区/县/县级市 $countryStr = ''; $countyArr = explode(' ', $info['street']); //根据' '来截取街道地址,抓取其中下标为2的数组中包含区或县的字符串 $countyTmpStr = $countyArr[2]; if (empty($countyTmpStr)) { //如果截取的第三个数组的字符串为空,则就是空 $countryStr = ''; } else { $quIndex = strpos($countyTmpStr, '区'); //区关键字的索引 if (!empty($quIndex)) { //如果索引不为空,即在字符串含有区关键字,且该字的索引不是0 $countryStr = strstr($countyTmpStr, '区', true) . '区'; } else { //如果索引为空,则继续找关键字 县 $xianIndex = strpos($countyTmpStr, '县'); //区关键字的索引 if (!empty($xianIndex)) { //如果索引不为空, $countryStr = strstr($countyTmpStr, '县', true) . '县'; } else { $shiIndex = strpos($countyTmpStr, '市'); //县级市关键字的索引 if (!empty($shiIndex)) { //如果索引不为空, $countryStr = strstr($countyTmpStr, '市', true) . '市'; } } } } $info['cityInfo'] = $countryStr; } // } //得到订单编号 if ($type == '22') { $originOrderId = ''; foreach ($orderInfo as $k => $values) { $originOrderId .= $values['originOrderId'] . ','; } $originOrderId = trim($originOrderId, ','); $orderList = array(); $result = CommonModel::get_orderInfoFromOrderSys($originOrderId); $i = 0; if ($result['data']) { foreach ($result['data'] as $keys => $val) { foreach ($val['orderDetail'] as $ks => $skuList) { if (!isset($skuList['orderDetailExtension']['oppositeSku']) || !isset($skuList['orderDetailExtension']['oppositeBarCode'])) { echo '<script>alert("请确认是否是兰亭的订单");</script>'; exit; } $i++; // echo "<pre>"; // print_r($ks); // echo "</pre>"; $orderList[$keys][$ks]['recordNumber'] = $val['order']['recordNumber']; $orderList[$keys][$ks]['oppositeSku'] = $skuList['orderDetailExtension']['oppositeSku']; $orderList[$keys][$ks]['oppositeBarCode'] = $skuList['orderDetailExtension']['oppositeBarCode']; } } } else { $data = array('data' => array('不能得到订单信息'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm&page=1'); goErrMsgPage($data); exit; } $this->smarty->assign('totalCount', $i); //得到SKU条码的个数 $this->smarty->assign('orderList', $orderList); } else { $this->smarty->assign('orderInfo', $orderInfo); } // echo "<pre>"; // print_r($result); // print_r($orderList); // echo "</pre>"; // exit; if ($_SESSION['userId'] == 253) { echo "<pre>"; print_r($orderInfo); } switch ($type) { case 11: //芬哲圆通打印 已改 $this->smarty->display('printlabelytoForFZ.htm'); break; case 12: //芬哲申通打印 已改 $this->smarty->display('printlabelstoForFZ.htm'); break; case 13: //芬哲韵达打印 yigai $this->smarty->display('printlabelyunForFZ.htm'); break; case 131: //芬哲天天打印 已改 $this->smarty->display('printlabelttForFZ.htm'); break; case 132: //芬哲中通打印 yigai $this->smarty->display('printlabelztoForFZ.htm'); break; case 133: //芬哲EMS打印 yigai $this->smarty->display('printlabelEMSForFZ.htm'); break; case 134: //芬哲加运美打印 yigai $this->smarty->display('printlabelJYMForFZ.htm'); break; case 135: //芬哲顺丰打印 gai $this->smarty->display('printlabelsfForFZ.htm'); break; case 14: //哲果圆通打印 yijia $this->smarty->display('printlabelytoForZG.htm'); break; case 15: //哲果申通打印 yigai $this->smarty->display('printlabelstoForZG.htm'); break; case 16: //哲果韵达打印 yigai $this->smarty->display('printlabelyunForZG.htm'); break; case 17: //哲果顺丰打印 yigai $this->smarty->display('printlabelsfForZG.htm'); break; case 161: //哲果天天打印 yigai $this->smarty->display('printlabelttForZG.htm'); break; case 162: //哲果中通打印 yigai $this->smarty->display('printlabelztoForZG.htm'); break; case 163: //哲果加运美打印 这个没有在198服务器上找到,所以这个面单可能是有错的,目前是用EB0001加运美打印 $this->smarty->display('printlabelJYMForZG.htm'); break; case 164: //哲果EMS打印 yigai $this->smarty->display('printlabelEMSForZG.htm'); break; case 18: //EB0001申通打印 yigai $this->smarty->display('printlabelstoForEB.htm'); break; case 19: //EB0001速尔打印 yigai $this->smarty->display('printlabelserForEB.htm'); break; case 20: //EB0001中通打印 yigai $this->smarty->display('printlabelZTOforEB.htm'); break; case 110: //EB0001顺丰打印 yigai $this->smarty->display('printlabelsfForEB.htm'); break; case 181: //EB0001圆通打印 yigai $this->smarty->display('printlabelytoForEB.htm'); break; case 182: //EB0001加运美打印 已改 $this->smarty->display('printlabelJYMForEB.htm'); break; case 183: //EB0001国通打印 yigai $this->smarty->display('printlabelgtForEB.htm'); break; case 184: //EB0001EMS打印 yigai $this->smarty->display('printlabelEMSForEB.htm'); break; case 22: //EB0001兰亭条码打印 $this->smarty->display('printLabelforEB_LT.htm'); break; default: redirect_to("index.php?mod=dispatchBillQuery&act=showForm&storeId=1"); return false; } }