public function act_handelSubmit() { $expressdata = null; if ($_SERVER['REQUEST_METHOD'] == "POST") { // 以post方式提交的数据为 一个订单有多个跟踪号的情况 $orderid = trim($_POST['orderid']); $expressid = trim($_POST['expressid']); $expressid = trim($_POST['expressid'], "\n"); $exidar = explode("\n", $expressid); $len = count($exidar); for ($i = 0; $i < $len; $i++) { // 去除中间的空白 $temp = trim($exidar[$i]); if (empty($temp)) { unset($exidar[$i]); } } if (empty($exidar)) { // 提交的是空白 self::$errCode = 0; self::$errMsg = '快递号为空!'; return; } $expressdata = $exidar; // $expressid = implode('和', $exidar); } else { $orderid = trim($_GET['orderid']); $expressid = trim($_GET['expressid']); $expressdata = $expressid; } if ($orderid < 1 || empty($orderid)) { // 不合法的id self::$errCode = 0; self::$errMsg = '单号不合法!'; return; } if (empty($expressdata)) { self::$errCode = 0; self::$errMsg = '追踪号码不能为空!'; return; } $po_obj = new PackingOrderModel(); $orderinfo = $po_obj->getOrderInfoById($orderid); if (empty($orderinfo)) { self::$errCode = 0; self::$errMsg = '单号不正确'; return; } if ($orderinfo['orderStatus'] != PKS_EX_TNRCK) { //该订单不在快递待复核状态 self::$errCode = 0; self::$errMsg = '该发货单不在快递待复核组!'; return; } $tir_obj = new TrackInfoRecordModel(); $result = $tir_obj->validataTracnumber($orderid, $expressdata, 1); self::$errCode = TrackInfoRecordModel::$errCode; self::$errMsg = TrackInfoRecordModel::$errMsg; return; }
public function act_packingscan() { $orderid = isset($_GET['orderid']) ? intval($_GET['order']) : 0; if (empty($orderid)) { self::$errCode = 0; self::$errMsg = '请输入订单号!'; return; } $po_obj = new PackingOrderModel(); $orderinfo = $po_obj->getOrderInfoById($orderid); if (empty($orderinfo)) { self::$errCode = 0; self::$errMsg = '该单号不存在!'; return; } if ($orderinfo['orderStatus'] != PKS_WPACKING) { // 该订单不在待包装状态 self::$errCode = 0; self::$errMsg = '该发货单不在待包装组!'; return; } self::$errCode = 1; self::$errMsg = 'Ok!'; return; }
public function view_waitWeighingList() { $pagesize = 100; //页面大小 $statusar = array(PKS_WWEIGHING, PKS_WWEIGHING_EX, PKS_INLANDWWEIGHING); $statusstr = implode(',', $statusar); $packing_obj = new PackingOrderModel(); $count = $packing_obj->getRecordsNumByStatus($statusar); //获得当前状态为待包装的发货单总数量 $pager = new Page($count, $pagesize); //分页对象 $billlist = $packing_obj->getBillList(' and orderStatus in (' . $statusstr . ') order by po.id ' . $pager->limit); $this->smarty->assign('billlist', $billlist); $ShipingTypeList = CommonModel::getShipingTypeListKeyId(); $count = count($billlist); for ($i = 0; $i < $count; $i++) { $billlist[$i]['shipingname'] = isset($ShipingTypeList[$billlist[$i]['transportId']]) ? $ShipingTypeList[$billlist[$i]['transportId']] : ''; } $acc_id_arr = array(); foreach ($billlist as $key => $valbil) { if (!in_array($valbil['accountId'], $acc_id_arr)) { array_push($acc_id_arr, $valbil['accountId']); } } $salesaccountinfo = CommonModel::getAccountInfo($acc_id_arr); $this->smarty->assign('salesaccountinfo', $salesaccountinfo); if ($count > $pagesize) { //分页链接 $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9)); } else { $pagestr = $pager->fpage(array(0, 2, 3)); } $this->smarty->assign('pagestr', $pagestr); $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '待包装称重')); $this->smarty->assign('navlist', $navlist); $toptitle = '待包装称重'; //顶部链接 $this->smarty->assign('toptitle', $toptitle); $toplevel = 2; //顶层菜单 $this->smarty->assign('toplevel', $toplevel); $secondlevel = '26'; //当前的二级菜单 $this->smarty->assign('secondlevel', $secondlevel); $this->smarty->assign('secnev', 3); //二级导航 $this->smarty->display('waitweighinglist.htm'); }
/** * 异常订单打印数据组装 */ public function act_abnormalOrderInfo($oids) { //获取订单信息 $now_position_info = PackingOrderModel::getaSetOfOrderInfo($oids); echo "<pre>"; print_r($now_position_info); exit; return $now_position_info; }
public function view_rollBackStock() { $orderid = isset($_GET['orderid']) ? intval($_GET['orderid']) : 0; if ($orderid < 1) { //传参不合法 $data = array('data' => array('参数不合法!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goErrMsgPage($data); exit; } $po_obj = new PackingOrderModel(); $orderinfo = $po_obj->getOrderInfoById($orderid); if (empty($orderinfo)) { $data = array('data' => array('指定发货单不存在!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goErrMsgPage($data); exit; } if ($orderinfo['orderStatus'] != PKS_UNUSUAL) { //该订单不在待复核状态 $data = array('data' => array('该订单不是异常订单!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $sku_havegot = $sod_obj->getSkuHavedone($orderid); //获得已经配货的sku列表 $rollbackresult = $sod_obj->rollBackStock($sku_havegot); if ($rollbackresult) { $data = array('data' => array('回滚成功!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goOkMsgPage($data); exit; } else { $data = array('data' => array('该订单不是异常订单!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } }
public function view_printGroupOrder2() { $groupsn = isset($_GET['groupsn']) ? trim($_GET['groupsn']) : 0; if (empty($groupsn)) { echo "请指定配货清单!"; exit; } $group_list = OmAvailableModel::getTNameList("wh_shipping_order_group", "*", "where shipOrderGroup='{$groupsn}' order by id asc"); if (!$group_list) { echo "该配货清单不存在!"; exit; } $time = time(); $userName = $_SESSION['userName']; //更新今日清单打印表 OmAvailableModel::updateTNameRow("wh_shipping_order_group_print", "set status='1',orderPrintUser='******',orderPrintTime='{$time}'", "where shipOrderGroup='{$groupsn}'"); //获取订单对应的车号 $orderids = array(); foreach ($group_list as $group) { if (!isset($orderids[$group['shipOrderId']])) { $orderids[$group['shipOrderId']] = $group['carNumber']; } } $o_arr = array(); foreach ($orderids as $order => $car_number) { $o_arr[] = $order; } $oids = implode(',', $o_arr); $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($oids); if (empty($ordersinfo)) { $data = array('data' => array('没有可打印内容!'), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $acc_id_arr = array(); foreach ($ordersinfo as &$orinfval) { $locationinfo = array(); $totalnum = 0; $package_type = ''; $iscard = ''; $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku"); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $iscard = printLabelModel::checkprintcard($orinfval['id']); $pmNameStr = CommonModel::getMaterInfoById($orinfval['pmId']); $orinfval['finalposition'] = $locationinfo; $totalStr = $totalnum . " " . $pmNameStr . " " . $orinfval['calcWeight'] . "KG"; if (!empty($package_type)) { $totalStr = $totalStr . " " . $package_type; } if (!empty($iscard)) { $totalStr = $totalStr . " " . $iscard; } $totalStr = $totalStr . " " . $orinfval['platformUsername']; $carrier = CommonModel::getShipingNameById($orinfval['transportId']); $orinfval['abbrshipname'] = CommonModel::getShipingAbbrNameById($orinfval['transportId']); $orinfval['totalStr'] = $totalStr; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['partionFromAddress'] = printLabelModel::getPartionFromAddress($orinfval['id'], $carrier, $orinfval['countryName']); if (!in_array($orinfval['accountId'], $acc_id_arr)) { array_push($acc_id_arr, $orinfval['accountId']); } } $salesaccountinfo = CommonModel::getAccountInfo($acc_id_arr); $this->smarty->assign('salesaccountinfo', $salesaccountinfo); $totalCount = count($ordersinfo); $this->smarty->assign('totalCount', $totalCount); $this->smarty->assign('orderids', $orderids); $this->smarty->assign('ordersinfo', $ordersinfo); $this->smarty->display('label50x100_22.htm'); }
function clearupData() { $result = array(); $idlist = isset($_POST['ids']) ? trim($_POST['ids']) : 0; if (empty($idlist)) { return $result; } $idarray = explode(',', $idlist); $po_obj = new PackingOrderModel(); $result = $po_obj->getOrderInfoByIdList($idarray); return $result; }
private function handelScanSubmit($ordertype) { $sku = isset($_POST['sku']) ? trim($_POST['sku']) : 0; //sku $sku = get_goodsSn($sku); if (empty($sku)) { self::$errCode = 0; self::$errMsg = '请输入sku'; return FALSE; } $orderid = isset($_POST['orderid']) ? abs(intval($_POST['orderid'])) : 0; //单号 if (empty($orderid)) { self::$errCode = 0; self::$errMsg = '请输入单号!'; return FALSE; } $num = isset($_POST['num']) ? intval($_POST['num']) : 0; //数量 if (!(is_int($num) && $num > 0)) { self::$errCode = 0; self::$errMsg = '请输入正确的数量!'; return FALSE; } $pName = isset($_POST['pname']) ? trim($_POST['pname']) : ''; //仓位 if (empty($pName)) { self::$errCode = 0; self::$errMsg = '仓位有误,请联系it'; return FALSE; } $pcko_obj = new PackingOrderModel(); $orderinfo = $pcko_obj->getOrderInfoById($orderid, ' and orderStatus=' . PKS_WGETGOODS); //发货单完整信息 if (empty($orderinfo)) { //订单号不存在 self::$errCode = 0; self::$errMsg = '订单号不存在!'; return FALSE; } /* 验证该订单的类型是否符合要求 */ if ($ordertype == 1) { //为快递单 if (!ShipingTypeModel::isExpressShiping($orderinfo['transportId'])) { self::$errCode = 0; self::$errMsg = '该订单为非快递单!'; return FALSE; } } elseif ($ordertype == 2) { //为非快递单 if (!ShipingTypeModel::isSmallpressShiping($orderinfo['transportId'])) { self::$errCode = 0; self::$errMsg = '该订单非小包订单!'; return FALSE; } } elseif ($ordertype == 3) { if (!ShipingTypeModel::isInlandShiping($orderinfo['transportId'])) { self::$errCode = 0; self::$errMsg = '该订单非国内快递订单!'; return FALSE; } } /***添加料号、配货数量验证 start ***/ if ($ordertype == 1) { $sod_obj = new ShipingOrderDetailModel(); $rtnNum = $sod_obj->checkOrderSku($orderid, $sku); if ($rtnNum == 0) { self::$errCode = 20; self::$errMsg = '发货单号不存在料号[' . $sku . ']'; return false; } else { $rtnNum = $sod_obj->checkSkuPickRecord($orderid, $sku, $pName); if ($rtnNum != 0) { self::$errCode = 20; self::$errMsg = '料号[' . $sku . ']已配货'; return false; } else { $actualNum = $sod_obj->checkSkuQty($orderid, $sku); $diffNum = $num - $actualNum; if ($diffNum > 0) { self::$errCode = 20; self::$errMsg = '料号[' . $sku . ']需配货' . $actualNum . '件现配' . $num . '件多配' . $diffNum . '件'; return false; } else { if ($diffNum < 0) { self::$errCode = 20; self::$errMsg = '料号[' . $sku . ']需配货' . $actualNum . '件现配' . $num . '件少配-' . $diffNum . '件'; return false; } else { } } } } } /***添加料号、配货数量验证 end ***/ $sod_obj = new ShipingOrderDetailModel(); $skulist = $sod_obj->getSkuListByOrderId($orderid); //该发货单下的全部sku列表 $sku_scaned = $sod_obj->getSkuHavedone($orderid); //该订单下的已配货的sku列表 foreach ($sku_scaned as $skval) { //去掉已配货的 if (array_key_exists($skval['shipOrderdetailId'], $skulist)) { unset($skulist[$skval['shipOrderdetailId']]); } } $matched = null; foreach ($skulist as $val) { if ($val['amount'] == $num && $val['sku'] == $sku) { //找到匹配的 $matched = $val; break; } } $islast = FALSE; if (count($skulist) == 1) { //为最后一个配货料号 $islast = TRUE; } if (empty($matched)) { //没找到数量匹配的 self::$errCode = 0; self::$errMsg = 'sku数量不对!'; return FALSE; } //删除库存 插入配货记录 $data = array('num' => $num, 'sku' => $sku, 'pName' => $pName, 'orderid' => $orderid, 'detailid' => $matched['id'], 'amount' => $num, 'totalnum' => $matched['amount'], 'userid' => $_SESSION['userId'], 'islast' => $islast, 'orderTypeId' => $orderinfo['orderTypeId'], 'shiptype' => $ordertype); $dbresult = $sod_obj->recordDataToSystem($data); if (!$dbresult) { //插入数据失败 self::$errCode = 0; self::$errMsg = '配货失败,请重试!'; return FALSE; } if ($islast) { //最后一个配货完成 // WhPushModel::pushOrderStatus($orderid,'STATESHIPPED_PENDREVIEW',$_SESSION['userId'],time()); //状态推送 self::$errCode = 2; self::$errMsg = '配货成功!'; return TRUE; } else { $skulist = $sod_obj->getSkuListInOneOrder($orderid); $sign = 0; $skulists = array(); foreach ($skulist as $k => $v) { $sku = $v['sku']; $amount = $v['amount']; //配货数量 $posId = $v['positionId']; //仓位ID $pName = $v['pName']; //仓位名称 $storeId = $v['storeId']; //仓库ID,默认1:深圳赛维 $skuInfo = getSkuInfoBySku($sku); //获取料号信息 $skuId = $skuInfo['id']; //料号ID $stockQty = get_SkuStockQty($skuId, $posId, $storeId); //库存数量 $skulists[$sign]['sku'] = $sku; $skulists[$sign]['amount'] = $amount; $skulists[$sign]['pName'] = $pName; $skulists[$sign]['positionId'] = $posId; $skulists[$sign]['stockqty'] = $stockQty; $sign++; } $skulist = $skulists; self::$errCode = 1; self::$errMsg = '配货成功!'; self::$data = $skulist; return TRUE; } }
public function act_applyforB() { $pid = isset($_GET['pid']) ? trim($_GET['pid']) : 0; if ($pid == '') { self::$errCode = 0; self::$errMsg = '输入非法值!'; return; } $idar = explode(',', $pid); foreach ($idar as $key => $idval) { $idar[$key] = intval($idval); } $o_count = count($idar); $orderist = OrderPrintListModel::getPrintList('*', ' where id in (' . implode(',', $idar) . ') and status!=1001 and storeId=2'); $n_count = count($orderist); if ($o_count != $n_count) { self::$errCode = 0; self::$errMsg = '申请提货不能包含未打印地址条订单或包含A仓订单'; return; } $oidar = array(); //发货单id数组 foreach ($orderist as $orlval) { //验证合法性 if ($orlval['is_delete'] == 1) { $data = array('data' => array('包含已经删除单号!', '单号id为' . $orlval['id']), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $tempar = explode(',', $orlval['orderIds']); $oidar = array_merge($oidar, $tempar); } $po_obj = new PackingOrderModel(); $qresult = $po_obj->changeStatusToWaitGetGoodsB(implode(',', $oidar)); OrderPrintListModel::deleteAsetOfPrint(implode(',', $idar)); printLabelModel::inserRecords($oidar, $_SESSION['userId']); if ($qresult) { $time = time(); self::$errCode = 1; self::$errMsg = '申请成功'; return; } else { self::$errCode = 0; self::$errMsg = '失败'; return FALSE; } }
public function act_weighingSubmitFZ() { $weight = isset($_POST['num']) ? floatval($_POST['num']) : 0; if ($weight <= 0) { self::$errCode = 0; self::$errMsg = '请输入正确的重量!'; return; } // $weight = $weight * 1000; $weight = round($weight); $packinguser = isset($_POST['userid']) ? intval($_POST['userid']) : 0; if ($packinguser <= 1) { self::$errCode = 0; self::$errMsg = '请输入配货人员!'; return; } $orderid = isset($_POST['orderid']) ? intval($_POST['orderid']) : 0; if (empty($orderid)) { self::$errCode = 0; self::$errMsg = '请填写单号!'; return; } $expressstr = isset($_POST['express']) ? trim($_POST['express']) : ''; if (empty($expressstr)) { self::$errCode = 0; self::$errMsg = '请填写快递单号!'; return; } $po_obj = new PackingOrderModel(); $orderinfo = $po_obj->getOrderInfoById($orderid); if (empty($orderinfo)) { self::$errCode = 0; self::$errMsg = '单号不存在!'; return; } if ($orderinfo['orderStatus'] != PKS_WWEIGHING_EX) { // 该订单不在国内称重状态 self::$errCode = 0; self::$errMsg = '该发货单不在国内称重组!'; return; } $data = array('weight' => $weight, 'userid' => $packinguser, 'orderid' => $orderid, 'status' => PKS_DONE, 'express' => $expressstr, 'storid' => 1); $result = $po_obj->recordWeightInfoFZ($data); if ($result) { //成功 WhPushModel::pushOrderStatus($orderid, 'STATEHASSHIPPED', $_SESSION['userId'], time(), $weight); //状态推送 self::$errCode = 1; self::$errMsg = 'OK'; return; } else { self::$errCode = 0; self::$errMsg = '操作失败!'; return; } }
function clearupData2($idlist) { $result = array(); $idarray = explode(',', $idlist); $po_obj = new PackingOrderModel(); $result = $po_obj->getOrderInfoByIdList($idarray); return $result; }
public function act_markUnusual1() { $userId = $_SESSION['userId']; $orderids = isset($_POST['orderids']) ? $_POST['orderids'] : ''; if (empty($orderids)) { self::$errCode = 0; self::$errMsg = '请选择发货单号!'; return; } if (!is_numeric($orderids)) { $tracknumber = $orderids; $info = orderWeighingModel::selectOrderId($tracknumber); if (!$info) { self::$errCode = 501; self::$errMsg = "此跟踪号不存在!"; return false; } $orderids = $info[0]['shipOrderId']; } $order_arr = explode(',', $orderids); OmAvailableModel::begin(); $po_obj = new PackingOrderModel(); $qresult = $po_obj->changeStatusToUnusual($orderids); if ($qresult) { foreach ($order_arr as $order) { $order_info = orderWeighingModel::selectOrderDetail($order); foreach ($order_info as $o_info) { $data = array(); $sku_info = InvRecordModel::getSkuInfo($o_info['sku']); $data = array('sku' => $o_info['sku'], 'applicantId' => $userId, 'applicantionTime' => time(), 'invReasonId' => 4, 'invStatus' => 0, 'systemNums' => $sku_info['actualStock']); $insertid = WaitInventoryModel::insertRow($data); if (!$insertid) { self::$errCode = 0; self::$errMsg = '标记异常发货单失败!'; OmAvailableModel::rollback(); return false; } } } self::$errCode = 200; self::$errMsg = '标记异常发货单成功!'; OmAvailableModel::commit(); return true; } else { self::$errCode = 0; self::$errMsg = '标记异常发货单失败!'; return false; } }
<?php @session_start(); error_reporting(-1); set_time_limit(0); $orderid = isset($_POST['ids']) ? trim($_POST['ids']) : ''; $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($orderid); $text = ''; $lt = "\t"; $ln = "\r\n"; foreach ($ordersinfo as $order) { $all_amount = 0; $all_price = 0; $text .= '|' . $order['username'] . $lt; $text .= '|' . $order['username'] . $lt; $text .= '|' . str_replace(array("\n", "\r\n", "\r"), "", $order['street']) . $lt; $text .= '|' . str_replace(array("\n", "\r\n", "\r"), "", $order['address2']) . $lt; $text .= '|' . $lt; $text .= '|' . $order['city'] . $lt; $text .= '|' . $order['zipCode'] . $lt; $text .= '|' . $order['countryName'] . $lt; /* if(empty($order['ebay_couny'])){ $country_name = $order['countryName']; $c_sql = "select * from ebay_countrys where countryen='{$country_name}'"; $c_sql = $dbcon->execute($c_sql); $country = $dbcon->fetch_one($c_sql); $text .= '|'.$country['countrysn'].$lt; }else{ $text .= '|'.$order['ebay_couny'].$lt;
private function printDispatchOrder($oids, $type) { $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($oids); //echo "<pre>";print_r($ordersinfo);exit; if (empty($ordersinfo)) { $data = array('data' => array('没有可打印内容!'), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $acc_id_arr = array(); foreach ($ordersinfo as &$orinfval) { $locationinfo = array(); $totalnum = 0; $package_type = ''; $iscard = ''; $carrier = CommonModel::getShipingNameById($orinfval['transportId']); if ($type == 1 || $type == 6 || $type == 7) { //标签打印-50*100处理 if ($type == 7) { $tag = 0; } else { $tag = 1; } $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", $tag); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $iscard = printLabelModel::checkprintcard($orinfval['id']); } elseif ($type == 8) { if ($carrier == 'EUB' || $carrier == 'Global Mail' || $carrier == '德国邮政') { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($carrier == 'EUB') { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } else { if ($carrier == 'Global Mail' || $carrier == '德国邮政') { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } elseif ($carrier == '新加坡邮政') { $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", 0); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } } else { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($type == 3) { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } } else { if ($type == 4 || $type == 5) { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount'], 'price' => $tmval['itemPrice'], 'itemTitle' => $tmval['itemTitle']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } if ($type == 10) { $itemtitle = ""; foreach ($locationinfo as $key => $value) { $itemtitle .= $key + 1 . "、" . $value['itemTitle'] . "<br>"; } $orinfval['itemTitle'] = $itemtitle; $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $account = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['account'] = $account['account']; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); } //$orinfval['total'] = $eubtotal; if ($type == 2 || $type == 33) { //快递A4打印需分割成小数组 $locationinfo = array_chunk($locationinfo, 2); $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['account'] = $salesaccountinfo['account']; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); // print_r($orinfval); // exit; $pglist = array(); foreach ($ordersinfo as $order) { $pglist[] = $order['id']; } $olist = implode(",", $pglist); $this->smarty->assign('pglist', $olist); } if ($type == 3) { //EUB热敏打印 $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } if ($type == 7) { //新加坡热敏打印 $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } if ($type == 4 || $type == 5) { //Global Mail-100*100打印 //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } $pmNameStr = CommonModel::getMaterInfoById($orinfval['pmId']); $orinfval['pmNameStr'] = $pmNameStr; $orinfval['finalposition'] = $locationinfo; //$carrier = CommonModel::getShipingNameById($orinfval['transportId']); $orinfval['carrier'] = $carrier; $orinfval['totalnum'] = $totalnum; $orinfval['package_type'] = $package_type; if ($type == 1 || $type == 6) { //标签打印-50*100处理 $totalStr = $totalnum . " " . $pmNameStr . " " . $orinfval['calcWeight'] . "KG"; if (!empty($package_type)) { $totalStr = $totalStr . " " . $package_type; } if (!empty($iscard)) { $totalStr = $totalStr . " " . $iscard; } $totalStr = $totalStr . " " . $orinfval['platformUsername']; $orinfval['abbrshipname'] = CommonModel::getShipingAbbrNameById($orinfval['transportId']); //$orinfval['channelname'] = ShipingTypeModel::getChannelNameByIds($orinfval['transportId'], $orinfval['channelId']); //$orinfval['channelname'] = CommonModel::getChannelNameByIds($orinfval['transportId'], $orinfval['countryName']); $orinfval['totalStr'] = $totalStr; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['partionFromAddress'] = printLabelModel::getPartionFromAddress($orinfval['id'], $carrier, $orinfval['countryName']); } if ($type == 9) { //部分包货打印-50*100处理 $countryZh = CommonModel::getCountryNameCn($orinfval['countryName']); $isLast = printLabelModel::adjustIsLast($orinfval['id']); //是否是最后一个配货单 $doneOrder = printLabelModel::getAllOriginOrderId($orinfval['id']); $streetInfo = "<br>" . $orinfval['username'] . "<br>" . $orinfval['street'] . "<br>" . $orinfval['state'] . "<br>" . $orinfval['zipCode'] . "<br>" . $orinfval['countryName'] . "(" . $countryZh . ")"; if (!empty($doneOrder)) { $doneStr = "<br>包含配货单单号:" . $doneOrder; } else { $doneStr = ''; } if ($isLast && empty($doneStr)) { $orinfval['packinglog'] = "第一个包裹,全部打印"; $orinfval['streetInfo'] = $streetInfo; } elseif ($isLast && !empty($doneStr)) { $orinfval['packinglog'] = "最后一个包裹,全部打印" . $doneStr; $orinfval['streetInfo'] = $streetInfo; } elseif (!$isLast && empty($doneStr)) { $orinfval['packinglog'] = "第一个包裹,部分打印"; $orinfval['streetInfo'] = ''; } else { $orinfval['packinglog'] = "分包裹,部分打印" . $doneStr; $orinfval['streetInfo'] = ''; } } if ($type == 31 || $type == 32 || $type == 311 || $type == 312) { $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $totalPrice = 0; foreach ($locationinfo as $info) { $totalPrice += $info['price'] * $info['amount']; } $orinfval['totalPrice'] = $totalPrice; } } /*if($_SESSION['userId']==253){ echo "<pre>";print_r($ordersinfo); echo $type; }*/ //print_r($ordersinfo);exit; $totalCount = count($ordersinfo); $this->smarty->assign('totalCount', $totalCount); $this->smarty->assign('ordersinfo', $ordersinfo); switch ($type) { case 1: //标签打印-50*100 $this->smarty->display('label50x100.htm'); break; case 6: //带留言标签打印-50*100 $this->smarty->display('label50x100_2.htm'); break; case 2: //快递A4打印 $this->smarty->display('expressA4.htm'); break; case 3: //国际EUB-热敏打印 $this->smarty->display('eubprint.htm'); break; case 4: //德国Global Mail-100*100打印 $this->smarty->display('globalmailgerman.htm'); break; case 5: //非德国Global Mail-100*100打印 $this->smarty->display('unglobalmail.htm'); break; case 7: //新加坡打印 $this->smarty->display('singporeprint.htm'); break; case 8: //新加坡/EUB/Global Mail $this->smarty->display('mixprint.htm'); break; case 9: //部分包货打印50*100 $this->smarty->display('bufen50x100.htm'); break; case 31: //Finejo快递-A4(横向打印) $this->smarty->display('printlabelA4ForFZ.htm'); break; case 32: //哲果发货清单-A4打印 $this->smarty->display('printlabelA4ForZG.htm'); break; case 311: //EB001快递-A4(横向打印) $this->smarty->display('printlabelA4ForEB1.htm'); break; case 312: //EB001发货清单-A4打印 $this->smarty->display('printlabelA4ForEB2.htm'); break; case 33: //快递A4打印 $this->smarty->display('expressA4UpsUs.htm'); break; case 10: //快递50*100热敏打印 $this->smarty->display('printLabelExpress.htm'); break; default: redirect_to("index.php?mod=dispatchBillQuery&act=showForm&storeId=1"); return false; } }
public function act_recheckInfoSubmit() { $orderid = isset($_POST['orderid']) ? intval($_POST['orderid']) : 0; if (empty($orderid)) { self::$errCode = 0; self::$errMsg = '请输入发货单信息!'; return; } $sku = isset($_POST['sku']) ? trim($_POST['sku']) : 0; $sku = get_goodsSn($sku); if (empty($sku)) { self::$errCode = 0; self::$errMsg = '请输入sku'; return; } $num = isset($_POST['num']) ? intval($_POST['num']) : 0; if ($num < 1) { self::$errCode = 0; self::$errMsg = '请输入正确的数量'; return; } $po_obj = new PackingOrderModel(); $orderinfo = $po_obj->getOrderInfoById($orderid); if (empty($orderinfo)) { self::$errCode = 0; self::$errMsg = '订单不存在!'; return; } if ($orderinfo['orderStatus'] != PKS_WIQC) { //该订单不在待复核状态 self::$errCode = 0; self::$errMsg = '该发货单不在待复核组!'; return; } $sod_obj = new ShipingOrderDetailModel(); $skulist = $sod_obj->getSkuListByOrderId($orderid); if (count($skulist) == 0) { //没有料号 self::$errCode = 0; self::$errMsg = '该订单下没有料号信息,请及时反馈!'; return; } $rr_obj = new ReviewRecordsModel(); $scan_rocords = $rr_obj->getRiewRecordsByOrderid($orderid); $scanskus = array(); foreach ($scan_rocords as $sval) { if (array_key_exists($sval['shipOrderdetailId'], $skulist)) { $scanskus[] = $sval['sku']; unset($skulist[$sval['shipOrderdetailId']]); } } if (in_array($sku, $scanskus)) { self::$errCode = 0; self::$errMsg = $sku . '已复核过了'; return; } $isfound = FALSE; $numcorrect = true; foreach ($skulist as $skuval) { if ($skuval['sku'] == $sku) { $isfound = $skuval; if ($skuval['amount'] != $num) { $numcorrect = false; } break; } } if ($isfound === FALSE) { //没找到对应的料号信息 self::$errCode = 0; self::$errMsg = '料号[' . $sku . ']不存在'; return; } if ($numcorrect == false) { self::$errCode = 0; self::$errMsg = '复核数量与分拣数不符'; return; } $data = array(); $data['orderid'] = $orderid; //单号 $data['detailid'] = $isfound['id']; //detailid号 $data['sku'] = $sku; //sku $data['amount'] = $num; //复核数量 $data['totalNums'] = $isfound['amount']; //料号原始总数 $data['userid'] = $_SESSION['userId']; //复核扫描用户id $data['storeId'] = 1; //仓库id $islast = 0; if (count($skulist) == 1) { //当前为最后一个复核sku $data['islast'] = TRUE; $islast = 1; } else { $data['islast'] = FALSE; } $result = $rr_obj->recordReviewInfo($data); if ($result == FALSE) { self::$errCode = 0; self::$errMsg = '复核失败,复核记录插入失败'; return; } else { self::$errMsg = '成功!'; if ($islast) { //最后一个复核 WhPushModel::pushOrderStatus($orderid, 'PKS_WWEIGHING', $_SESSION['userId'], time()); //状态推送 //更新状态为待包装称重 $data = array('orderStatus' => PKS_WWEIGHING); WhShippingOrderModel::update($data, "id='" . $orderinfo['shipOrderId'] . "'"); self::$errCode = 2; return; } else { self::$errCode = 1; unset($skulist[$isfound['id']]); return $skulist; } } }
public function view_showForm() { global $memc_obj; $pagesize = 200; //页面大小 $whereSql = $this->buildWhereSql(); //echo $whereSql;exit; $packorder_obj = new PackingOrderModel(); $rownumber = $packorder_obj->getRowAllNumber($whereSql . ' group by po.id '); //获得所有的行数 $pager = new Page($rownumber, $pagesize); $billlist = $packorder_obj->getBillList($whereSql . ' group by po.id order by pd.pName ' . $pager->limit); //更具条件获得发货单 $packorder_obj->buildOrderinfo($billlist); /* //去除重复的 $currentid = NULL; $prekey = 0; foreach ($billlist as $key=>$valbill){ if ($currentid == $valbill['id']) { $billlist[$prekey]['originOrderId'] .= ', '.$valbill['originOrderId']; unset($billlist[$key]); }else { $prekey = $key; $currentid = $valbill['id']; } } */ $materInfo = CommonModel::getMaterInfoAll(); //获取包材信息 $materInfo = reverse_array($materInfo, 'pmName', 'id'); $shipingtyplist = CommonModel::getShipingTypeList(); //运输方式列表 $shipingtyplist = reverse_array($shipingtyplist, 'carrierNameCn', 'id'); $salesaccountlist = CommonModel::getSalesaccountList(); //获取销售帐号 $salesaccountlist = reverse_array($salesaccountlist, 'account', 'id'); //print_r($salesaccountlist);exit; $platformList = CommonModel::getPlatformInfo(); //获取平台帐号 $platformList = reverse_array($platformList, 'platform', 'id'); $this->smarty->assign('shipingtypelist', $shipingtyplist); $this->smarty->assign('salesaccountlist', $salesaccountlist); $this->smarty->assign('platformList', $platformList); foreach ($billlist as $key => $valbil) { $tracknumber = ''; $str_info = OmAvailableModel::getTNameList("wh_order_tracknumber", "tracknumber", "where shipOrderId='{$valbil['id']}' and is_delete=0"); if (!empty($str_info)) { $tracknumber = $str_info[0]['tracknumber']; } $billlist[$key]['tracknumber'] = $tracknumber; $originOrder_arr = array(); $originOrder_str = ''; $originOrder_info = OmAvailableModel::getTNameList("wh_shipping_order_relation", "originOrderId", "where shipOrderId='{$valbil['id']}'"); if (!empty($originOrder_info)) { foreach ($originOrder_info as $originOrder) { $originOrder_arr[] = $originOrder['originOrderId']; } $originOrder_str = implode(',', $originOrder_arr); } $billlist[$key]['originOrder'] = $originOrder_str; //运输方式 $billlist[$key]['shipingname'] = $shipingtyplist[$valbil['transportId']]; //包材 $billlist[$key]['materName'] = $materInfo[$valbil['pmId']]; //平台 $billlist[$key]['platformName'] = $platformList[$valbil['platformId']]; //销售账号 $billlist[$key]['salesaccountinfo'] = $salesaccountlist[$valbil['accountId']]; } if ($rownumber > $pagesize) { //分页 $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9)); } else { $pagestr = $pager->fpage(array(0, 2, 3)); } $this->smarty->assign('pagestr', $pagestr); $this->smarty->assign('billlist', $billlist); //发货单列表 $this->smarty->assign('secnev', 3); $libstu_obj = new LibraryStatusModel(); //出库状态类型 $libstatuslist = $libstu_obj->getAllLibStatusList(' and groupId in (4 ,5)'); $this->smarty->assign('outstatuslist', $libstatuslist); $toptitle = '订单查询'; //头部title $this->smarty->assign('toptitle', $toptitle); $storeId = isset($_GET['storeId']) ? intval($_GET['storeId']) : 0; if ($storeId == 1) { $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '发货单查询'), array('url' => '', 'title' => 'A仓发货单')); } elseif ($storeId == 2) { $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '发货单查询'), array('url' => '', 'title' => 'B仓发货单')); } else { $navlist = array(array('url' => '', 'title' => '出库'), array('url' => '', 'title' => '发货单查询')); } $this->smarty->assign('navlist', $navlist); $toplevel = 2; //一级菜单的序号 0 开始 $this->smarty->assign('toplevel', $toplevel); $secondlevel = isset($_GET['secondlevel']) ? trim($_GET['secondlevel']) : ''; if (empty($secondlevel)) { $secondlevel = '21'; //当前的二级菜单 } $this->smarty->assign('secondlevel', $secondlevel); $this->smarty->assign('platLists', $_SESSION['platformList']); $this->smarty->assign('accounts', $_SESSION['accountList']); $this->smarty->assign('shippingList', $_SESSION['shippingList']); $this->smarty->display('dispatchbillquery.htm'); }
public function view_editeSubmit() { $recipient = isset($_POST['recipient']) ? trim($_POST['recipient']) : ''; //收件人 $recipient = mysql_real_escape_string($recipient); $email = isset($_POST['email']) ? trim($_POST['email']) : ''; //邮箱 $email = mysql_real_escape_string($email); $countryname = isset($_POST['countryname']) ? trim($_POST['countryname']) : ''; //国家 $countryname = mysql_real_escape_string($countryname); //echo $countryname;exit; $abbreviation = isset($_POST['abbreviation']) ? trim($_POST['abbreviation']) : ''; //国家简称 $abbreviation = mysql_real_escape_string($abbreviation); $state = isset($_POST['state']) ? trim($_POST['state']) : ''; //州/省 $state = mysql_real_escape_string($state); $city = isset($_POST['city']) ? trim($_POST['city']) : ''; //市 $city = mysql_real_escape_string($city); $street = isset($_POST['street']) ? trim($_POST['street']) : ''; //街道 $street = mysql_real_escape_string($street); $address2 = isset($_POST['address2']) ? trim($_POST['address2']) : ''; //地址二 $address2 = mysql_real_escape_string($address2); $address3 = isset($_POST['address3']) ? trim($_POST['address3']) : ''; //地址三 $address3 = mysql_real_escape_string($address3); $currency = isset($_POST['currency']) ? trim($_POST['currency']) : ''; //币种 $currency = mysql_real_escape_string($currency); $shipping = isset($_POST['shippingtype']) ? intval($_POST['shippingtype']) : 0; //运输方式id $sellaccount = isset($_POST['sellaccount']) ? trim($_POST['sellaccount']) : ''; //销售账号 $sellaccount = mysql_real_escape_string($sellaccount); //$channel = isset($_POST['channel']) ? intval($_POST['channelId']) : 0; //渠道id $calcWeight = isset($_POST['calcWeight']) ? floatval($_POST['calcWeight']) : 0; //估算重量 $calcShipping = isset($_POST['calcShipping']) ? floatval($_POST['calcShipping']) : 0; //计算运费 $actualweight = isset($_POST['actualweight']) ? floatval($_POST['actualweight']) : 0; //实际重量 $acturalfee = isset($_POST['acturalfee']) ? floatval($_POST['acturalfee']) : 0; //实际重量 $orderid = isset($_POST['orderid']) ? intval($_POST['orderid']) : 0; if ($orderid < 1) { //id不合法 $data = array('data' => '发货单号不正确!', 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } $str = "\n username='******', email='{$email}', countryName='{$countryname}',countrySn='{$abbreviation}',\n state='{$state}', city='{$city}', street='{$street}', address2='{$address2}', address3='{$address3}',\n currency='{$currency}', transportId={$shipping}, account='{$sellaccount}', calcWeight='{$calcWeight}',\n calcShipping={$calcShipping}\n "; //echo $str;exit; $sod_obj = new ShipingOrderDetailModel(); $recordinfo = $sod_obj->getShippingOrderRecordsById($orderid); if (!empty($recordinfo)) { //更新记录信息 $str1 = " actualWeight={$actualweight} , actualShipping={$acturalfee}"; $ur = $sod_obj->updateRecords($str1, ' and shipOrderId=' . $orderid); if (!$ur) { //更新失败 $data = array('data' => array('更新失败!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } } $po_obj = new PackingOrderModel(); $upre = $po_obj->updateShipingorder($str, ' and id=' . $orderid); if ($upre) { //更新成功 $data = array('data' => array('更新成功!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goOkMsgPage($data); exit; } else { $data = array('data' => array('更新失败!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } }