$add3 = str_replace(array("'", "´", "&", "&"), array("'", "'", " ", " "), $add3); $packagetype = 'CP'; $servicelevel = 'EX'; $transportation = 'prepaid'; $description = 'Clothing and Accessories'; $nums = 1; $weight = round($res['calcWeight'], 1); $receiver = "\n<Receiver>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<CompanyName>{$r_name}</CompanyName>\t\t\t\t\t\n\t\t\t\t\t\t\t<ContactPerson>{$r_name}</ContactPerson>\t\t\t\t\t\n\t\t\t\t\t\t\t<AddressLine1>{$add1}</AddressLine1>\t\t\t\t\t\n\t\t\t\t\t\t\t<AddressLine2>{$add2}</AddressLine2>\t\t\t\t\t\n\t\t\t\t\t\t\t<AddressLine3>{$add3}</AddressLine3>\t\t\t\t\t\n\t\t\t\t\t\t\t<City>{$r_city}</City>\t\t\t\t\t\n\t\t\t\t\t\t\t<CountryCode>{$r_country}</CountryCode>\t\t\t\t\t\n\t\t\t\t\t\t\t<PostalCode>{$r_postcode}</PostalCode>\t\t\t\t\t\n\t\t\t\t\t\t\t<StateOrProvince>{$r_province}</StateOrProvince>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<Phone>{$r_phone}</Phone>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</Receiver>\n"; $shipment = "\n<Shipment>\n\t\t\t\t\t\t\t<ServiceLevel>{$servicelevel}</ServiceLevel>\n\t\t\t\t\t\t\t<PackageType>{$packagetype}</PackageType>\t\t\t\t\t\n\t\t\t\t\t\t\t<NumberOfPackages>{$nums}</NumberOfPackages>\n\t\t\t\t\t\t\t<ShipmentActualWeight>{$weight}</ShipmentActualWeight>\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<DescriptionOfGoods>{$description}</DescriptionOfGoods>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<Reference1>{$orderid}</Reference1>\t\t\t\t\t\n\t\t\t\t\t\t\t<Reference2>{$tid}</Reference2>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<BillingOption>PP</BillingOption>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</Shipment>\n"; $xml .= "\n<OpenShipment ShipmentOption=\"\" ProcessStatus=\"\">\n"; $xml .= $receiver; $xml .= $shipfrom; $xml .= $shipment; $inovice = "\n<Invoice>\n\t\t\t\t\t\t\t<ReasonForExport></ReasonForExport>\t\t\t\t\t\n\t\t\t\t\t\t\t<TermOfSale></TermOfSale>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<InvoiceCurrency>USD</InvoiceCurrency>"; //发票信息 $detail = WhShippingOrderdetailModel::getShipDetails($orderid); $tPrice = 0; if ($detail) { foreach ($detail as $values) { $prices += $detail['itemPrice'] * $detail['amount']; } } $tPrice = $tPrice != 0 ? round(floatval($tPrice), 4) : 0; // $sql = "SELECT SUM(ebay_itemprice*ebay_amount) as tPrice FROM ebay_orderdetail WHERE ebay_ordersn = '{$ordersn}'"; //$query = $dbcon->execute($sql); // $result = $dbcon->fetch_one($query); // $tPrice = isset($result['tPrice']) ? round(floatval($result['tPrice']),4) : 0; $nPrice = rand(140, 190); $pFlag = $tPrice > 200 ? true : false; $result = WhShippingOrderdetailModel::select_datail_category($orderid); // $sql = "SELECT b.goods_category,a.sku,a.ebay_itemtitle,a.ebay_amount,a.ebay_itemprice FROM ebay_orderdetail as a
$ebay_userid = $order['platformUsername']; //买家ID $ebay_username = $order['username']; $ebay_account = CommonModel::getAccountNameById($order['accountId']); //店铺账号 $ebay_state = $order['state']; $ebay_city = $order['city']; $ebay_street = $order['street']; $ebay_address = $ebay_state . $ebay_city . $ebay_street; //买家地址 $ebay_phone = $order['landline']; $ebay_phone1 = $order['phone']; //$ebay_ordersn = $order['ebay_ordersn']; //order表联系orderdetail表的foreginkey $tel1 = !$order['landline'] ? "" : str_replace('-', '', $order['landline']); $tel = $tel1 ? $tel1 : ($order['phone'] ? $order['phone'] : ""); $detail = WhShippingOrderdetailModel::getShipDetails($shipOrderId); //获取发货单明细 $totalAmount = 0; //总件数 $goodsInfo = ""; //订单中的商品sku及对应数量的组合信息,用"/"隔开 foreach ($detail as $val) { $totalAmount += $val['amount']; $sku = $val['sku']; $cs = strstr($val['itemTitle'] == '##' ? "" : $val['itemTitle'], '#'); //截取itemtile字段,得到color and size $goodsInfo = $goodsInfo . $sku . ' ' . $cs . $val['amount'] . '件/ '; } $count = count($detail); ?> <div id="main">
/** * WaveBuildAct::split_signle_shipOrder() * 单个发货单拆分成多个配货单 * @param int $shipOrderId 订单ID * @param array $order_detail 订单明细 * @return void */ public function split_signle_shipOrder($shipOrderId, $order_detail = '') { $shipOrderId = intval($shipOrderId); if (empty($order_detail)) { $order_detail = WhShippingOrderdetailModel::getShipDetails($shipOrderId); } $new_order_detail = array(); foreach ($order_detail as $val) { if ($val['amount'] > 1) { for ($i = 1; $i <= $val['amount']; $i++) { $new_order_detail[] = array('sku' => $val['sku'], 'amount' => 1, 'positionId' => $val['positionId'], 'pName' => $val['pName']); } } else { $new_order_detail[] = $val; } } $per_wave = array(); //每个波次料号临时存放表 foreach ($new_order_detail as $val) { $per_wave[] = $val; $limit_info = self::get_order_limit_info($per_wave); //获取波次临时存放表的总重量、体积、料号数量信息。 $is_wave = self::judge_split_wave($limit_info); //判断是否符合波次拆分规则 if ($is_wave == TRUE) { array_pop($per_wave); //将最后一个加入的料号剔除 $wave_detail = $per_wave; $per_wave = array(); if (empty($wave_detail)) { $wave_detail[] = $val; } else { $per_wave[] = $val; } self::make_wave($shipOrderId, 0, 1, $wave_detail, 1); } } if (!empty($per_wave)) { self::make_wave($shipOrderId, 0, 1, $per_wave, 1); } }
public function getTaoBaoOrderInfo($orderInfo) { $orderInfo = $orderInfo; // $sod_obj = new ShipingOrderDetailModel(); foreach ($orderInfo as &$info) { $totalAmount = 0; //总件数 $goodsInfo = ""; //订单中的商品sku及对应数量的组合信息,用"/"隔开 $orderDetail = WhShippingOrderdetailModel::getShipDetails($info['id']); foreach ($orderDetail as $detail) { $totalAmount += $detail['amount']; $cs = strstr($detail['itemTitle'] == '##' ? "" : $detail['itemTitle'], '#'); //截取itemtile字段,得到color and size $goodsInfo = $goodsInfo . $detail['sku'] . ' ' . $cs . $detail['amount'] . '件/ '; } $address = $info['state'] . $info['city'] . $info['street']; //买家地址 $info['goodsInfo'] = $totalAmount . '件 /' . $goodsInfo; $info['address'] = $address; } return $orderInfo; }