public static function orderLog($orderid, $ss, $note, $orderType = "") { !self::$dbConn ? self::initDB() : null; $where = "where id={$orderid}"; $orderinfo = OmAvailableModel::getTNameList("om_unshipped_order", "*", $where); $sql = array(); $sql['operatorId'] = $_SESSION['sysUserId']; $sql['omOrderId'] = $orderid; //$sql['note'] = "编辑订单"; $sql['note'] = $note; $sql['sql'] = mysql_real_escape_string($ss); $sql['createdTime'] = time(); if (!empty($orderType) && $orderinfo[0]['orderType'] != $orderType) { $sql['oldStatus'] = $orderinfo[0]['orderType']; $sql['newStatus'] = $orderType; $sql['note'] .= "修改订单状态"; } $strmctime = date('Y_m', time()); $sql = "INSERT INTO om_order_log_" . $strmctime . " set " . array2sql($sql); $sql = self::$dbConn->query($sql); if ($sql) { return true; } else { return false; //echo $sql; } }
public function act_accountList() { $select = " id ,account "; $where = " where is_delete = 0 and token <> '' order by account "; $accountList = OmAvailableModel::getTNameList("fb_account", $select, $where); return $accountList; }
function act_getProducts2pc($select, $where) { $listArr = UserCacheModel::getOpenSysApi('pc.getEbayProducts2PcProducts', array('all' => 'all'), 'gw88'); if ($listArr) { foreach ($listArr as $value) { $tName = 'pc_products'; $where = "WHERE is_delete=0 and productsStatus=1 and sku='{$value['sku']}'"; $skuCount = OmAvailableModel::getTNameCount($tName, $where); if (!$skuCount) { $pc_pro = array(); $pc_pro['id'] = $value['id']; if (!empty($value['sku'])) { $tmpArr = explode('_', $value['sku']); $pc_pro['spu'] = $tmpArr[0]; } $pc_pro['sku'] = $value['sku']; $pc_pro['productsStatus'] = 1; $pc_pro['productsComfirmerId'] = getPersonIdByName($value['comfirmuser']); $pc_pro['productsComfirmTime'] = $value['comfirmtime']; OmAvailableModel::addTNameRow2arr($tName, $pc_pro); } } self::$errCode = 200; self::$errMsg = 'success'; return true; } else { self::$errCode = 404; self::$errMsg = 'error'; return false; } }
public function act_postsku() { $sku = isset($_POST['sku']) ? trim($_POST['sku']) : ""; $sku = get_goodsSn($sku); $position = isset($_POST['position']) ? trim($_POST['position']) : ""; $num = isset($_POST['num']) ? trim($_POST['num']) : ""; $num = intval($num); if (empty($position)) { self::$errCode = 502; self::$errMsg = "仓位不能为空"; return false; } if ($num < 1) { self::$errCode = 502; self::$errMsg = "{$sku}出库数量{$num}有误!"; return false; } $checkonhandle = wrapperSkuOutModel::selectstock($sku); if (empty($checkonhandle)) { self::$errCode = 502; self::$errMsg = "{$sku}材料未导入库存信息表!"; return false; } $skuinfo = whShelfModel::selectSku(" where sku = '{$sku}'"); if (empty($skuinfo)) { self::$errCode = 502; self::$errMsg = "{$sku}材料没信息!"; return false; } else { $skuId = $skuinfo['id']; $purchaseId = $skuinfo['purchaseId']; } $positon_info = OmAvailableModel::getTNameList("wh_position_distribution", "id", "where pName='{$position}' and storeId in(1,2)"); if (empty($positon_info)) { self::$errCode = 502; self::$errMsg = "无仓位号信息"; return false; } else { $positionId = $positon_info[0]['id']; } $relation_info = OmAvailableModel::getTNameList("wh_product_position_relation", "id", "where pId='{$skuId}' and positionId='{$positionId}' and storeId in(1,2)"); if (empty($relation_info)) { self::$errCode = 502; self::$errMsg = "包材和仓位不对应"; return false; } $paraArr = array('ordersn' => date('YmdHis', time()), 'sku' => $sku, 'amount' => $num, 'purchaseId' => $purchaseId, 'ioType' => 1, 'ioTypeId' => 26, 'userId' => $_SESSION['userId'], 'reason' => '包材出库', 'positionId' => $positionId); $WhIoRecordsAct = new WhIoRecordsAct(); $tt = $WhIoRecordsAct->act_addIoRecoresForWh($paraArr); //出库记录 self::$errCode = 200; self::$errMsg = "{$sku}出库{$num}个成功!"; return true; }
function act_deleteTmpProsById() { $id = intval($_POST['id']); if ($id <= 0) { self::$errCode = '101'; self::$errMsg = '��Ч��¼��ɾ��ʧ��'; return false; } $tName = 'pc_tmp_products_return'; $where = "WHERE id={$id}"; OmAvailableModel::deleteTNameRow($tName, $where); self::$errCode = '200'; self::$errMsg = "ɾ���ɹ�"; return true; }
public function view_skuInfo() { $sku = isset($_GET['sku']) ? trim($_GET['sku']) : ""; //$spu = ExportsToXlsModel::getGoods($sku); $spu = GoodsModel::getSkuList($sku); $spu = $spu['spu']; $where = "where spu = '{$spu}'"; $skuinfo = OmAvailableModel::getTNameList("pc_goods", "*", $where); $skuStock = array(); foreach ($skuinfo as $key => $value) { $sku = $value['sku']; //获取库存 $skuStock = WarehouseAPIModel::getSkuStock($sku); //获取料号信息 //$skumsg = ExportsToXlsModel::getGoods($sku); $skumsg = GoodsModel::getSkuList($sku); //获取缓存表信息 $where = "where sku='{$sku}'"; $skuStatics = OmAvailableModel::getTNameList("om_sku_daily_status", "*", $where); $skuStockList = array(); $skuStockList['nums'] = $skuStock; $skuStockList['sku'] = $skumsg['sku']; $skuStockList['spu'] = $skumsg['spu']; $skuStockList['goodsName'] = $skumsg['goodsName']; $skuStockList['goodsCost'] = $skumsg['goodsCost']; $skuStockList['goodsWeight'] = $skumsg['goodsWeight']; $skuStockList['AverageDailyCount'] = $skuStatics['AverageDailyCount']; $skuStockList['waitingSendCount'] = $skuStatics['waitingSendCount']; $skuStockList['xuniCount'] = $skuStatics['waitingSendCount']; $skuStockList['goodsStatus'] = $skumsg['goodsStatus']; $path = $skumsg['goodsCategory']; $cateName = GoodsModel::getCategoryInfoByPath($path); $skuStockList['cateName'] = $cateName['name']; $skuStockList['isNew'] = $skumsg['isNew']; $skuStockList['pmId'] = $skumsg['pmId']; $pmName = GoodsModel::getMaterInfoById($skumsg['pmId']); $skuStockList['pmName'] = $pmName['pmName']; //print_r($pmName); $pName = $skumsg['purchaseId']; $skuStockList['pName'] = UserModel::getUsernameById($pName); $skuStockList['isPacking'] = $skumsg['isPacking']; $skuStockList['whName'] = "深圳A仓"; $skuStock_arr[] = $skuStockList; } $this->smarty->assign("skuStockList", $skuStock_arr); //print_r($skuStockList); $this->smarty->display("skuInfo.htm"); }
public static function applyTheLineEUBTrackNumber($recordnumber, $tracknumber) { !self::$dbConn ? self::initDB() : null; $SYSTEM_ACCOUNTS = OmAvailableModel::getPlatformAccount(); $accountIds = array(); foreach ($SYSTEM_ACCOUNTS['Amazon'] as $id => $account) { $accountIds[] = $id; } //print_r($SYSTEM_ACCOUNTS['Amazon']); $tableName = 'om_unshipped_order'; $where = " WHERE recordNumber='{$recordnumber}' AND accountId in ('" . join("','", $accountIds) . "') AND is_delete =0 AND storeId=1 "; $tinfo = OrderindexModel::showOnlyOrderList($tableName, $where); self::$errMsg = ''; if ($tinfo) { $omOrderId = $tinfo[0]['id']; $trackinfo = OrderindexModel::selectOrderTracknumber(" WHERE tracknumber = '" . $tracknumber . "' AND is_delete = 0 "); //var_dump($trackinfo); if ($trackinfo) { self::$errCode = "001"; self::$errMsg = " 第" . $row . "行已经存在跟踪" . $tinfo['ebay_tracknumber'] . " 新跟踪号[{$tracknumber}]更新失败<br>"; return false; } else { $data['omOrderId'] = $omOrderId; $data['tracknumber'] = $tracknumber; $data['addUser'] = $_SESSION['sysUserId']; $data['createdTime'] = time(); $msg = OrderRecordModel::insertOrderTrackRow($data); //echo $msg; if (!$msg) { self::$errCode = "001"; self::$errMsg = " 第" . $row . "行订单号[{$recordnumber}]添加跟踪号[{$tracknumber}]失败<br>"; return false; } } self::$errCode = "200"; self::$errMsg = "获取数据成功"; return true; //失败则设置错误码和错误信息, 返回false } else { self::$errCode = "001"; self::$errMsg = " 第" . $row . "行订单号[{$recordnumber}]不是亚马孙订单或者不存在系统<br>"; return false; } }
function act_insertBlackList($data, $table) { //表名,SET,WHERE $key = array(); $value = array(); foreach ($data as $k => $v) { $key[] = $k; $value[] = $v; } $set = " (" . implode(',', $key) . ") VALUE ('" . implode("','", $value) . "')"; $ret = OmAvailableModel::addTNameRow($table, $set); if ($ret) { return true; } else { self::$errCode = OmAvailableModel::$errCode; self::$errMsg = OmAvailableModel::$errMsg; return false; } }
/** * pda_ExpressWeighingAct::act_pda_ExpressId() * @author cxy * @return */ public function act_pda_ExpressId() { $userId = $_SESSION['userId']; $ebay_id = trim($_POST['ebay_id']); if (empty($userId)) { self::$errCode = '0'; self::$errMsg = '系统登录超时,请先关闭浏览器 然后登录扫描!!'; return false; } if (empty($ebay_id)) { self::$errCode = 0; self::$errMsg = '请填写单号!'; return; } $where = "where id={$ebay_id}"; $order = orderPartionModel::selectOrder($where); if (!$order) { self::$errCode = 0; self::$errMsg = $ebay_id . '发货单不存在!'; return false; } if ($order[0]['isExpressDelivery'] != 1) { self::$errCode = 0; self::$errMsg = $ebay_id . '此发货单不是快递发货单!'; return false; } if ($order[0]['orderStatus'] != PKS_WWEIGHING) { self::$errCode = 0; self::$errMsg = $ebay_id . '此发货单状态不是在待称重状态!'; return false; } $result = OmAvailableModel::getTNameList("wh_shipping_order_note_record ", "content", "where shipOrderId='{$ebay_id}' and is_delete =0 "); $note = $result[0]['content']; $res['content'] = $note; self::$errCode = 200; self::$errMsg = $ebay_id . "发货单号正确,请填写该发货单的重量,注意填写为的重量单位为KG!"; return $res; }
function act_addAutoSpuForOld() { $data = array(); $data['spu'] = trim($_POST['spu']); $data['isSingSpu'] = trim($_POST['isSingSpu']); $data['createdTime'] = time(); $data['purchaseId'] = $_SESSION['userId']; if (preg_match("/^[A-Z]{2}[0-9]{6}\$/", $data['spu'])) { $data['prefix'] = substr($data['spu'], 0, 2); $data['sort'] = intval(substr($data['spu'], 2)); } //验证spu是否已经存在 if ($data['isSingSpu'] == 1) { $tName = 'pc_goods'; $where = "WHERE spu='{$data['spu']}' and is_delete=0"; } else { $tName = 'pc_goods_combine'; $where = "WHERE combineSpu='{$data['spu']}' and is_delete=0"; } $res = OmAvailableModel::getTNameCount($tName, $where); if (empty($res)) { self::$errCode = 03; self::$errMsg = "{$data['spu']} 不在系统中存在,请重新添加"; return false; } else { $tName = 'pc_auto_create_spu'; $where = "WHERE spu='{$data['spu']}'"; $countSpu = OmAvailableModel::getTNameCount($tName, $where); if ($countSpu) { self::$errCode = 04; self::$errMsg = "{$data['spu']} 已经添加到自动生成SPU列表中"; return false; } if (SpuModel::insertSkuRow($data)) { return true; } else { self::$errCode = 05; self::$errMsg = '添加失败'; return false; } } }
function act_updateTNameRow() { $jsonArr = isset($_GET['jsonArr']) ? $_GET['jsonArr'] : ''; //传过来的base64编码的json字符串 if (empty($jsonArr)) { self::$errCode = 101; self::$errMsg = '参数数组为空'; return false; } $jsonArr = json_decode(base64_decode($jsonArr), true); //对base64及json解码 if (!is_array($jsonArr)) { self::$errCode = 103; self::$errMsg = '参数数组不是数组格式'; return false; } $tName = $jsonArr['tName']; //表名 $set = $jsonArr['set']; //set,用关键字SET $where = $jsonArr['where']; //where,要带上关键字WHERE if (empty($tName) || empty($set) || empty($where)) { self::$errCode = '300'; self::$errMsg = '必要参数不完整'; return false; } $affectRows = OmAvailableModel::updateTNameRow($tName, $set, $where); if ($affectRows !== FALSE) { self::$errCode = '200'; self::$errMsg = '成功'; return $affectRows; } else { self::$errCode = '404'; self::$errMsg = '数据库操作错误'; return false; } }
$tName = 'pc_goods_combine'; $select = 'combineSpu,combineUserId,addTime'; $where = "WHERE is_delete=0 limit {$start},{$per}"; $combineSpuList = OmAvailableModel::getTNameList($tName, $select, $where); foreach ($combineSpuList as $value) { $combineSpu = $value['combineSpu']; $combineUserId = $value['combineUserId']; $addTime = $value['addTime']; if (empty($combineSpu)) { continue; } $tName = 'pc_auto_create_spu'; $where = "WHERE spu='{$combineSpu}'"; $count1 = OmAvailableModel::getTNameCount($tName, $where); if (!$count1) { $dataAuto = array(); $dataAuto['spu'] = $combineSpu; $dataAuto['purchaseId'] = $combineUserId; $dataAuto['createdTime'] = $addTime; $dataAuto['status'] = 2; $dataAuto['isSingSpu'] = 2; if (strpos($combineSpu, 'CB') === 0) { $dataAuto['prefix'] = 'CB'; } OmAvailableModel::addTNameRow2arr($tName, $dataAuto); echo "{$combineSpu} insert autoCreateSpu success\n"; } else { echo "{$combineSpu} has exist autoCreateSpu\n"; } } }
function act_getSkuId($sku) { $field = ' id '; $where = " where sku = '{$sku}' limit 0,1 "; $result = OmAvailableModel::getTNameList('ph_goods', $field, $where); return $result[0]['id']; }
/** *功能:我自己运行的接口,自由发送mq队列 * */ public function act_pcForMQByZqt() { $tName = 'pc_goods'; $where = "WHERE is_delete=0 and id in(87276,87277,87278,87279)"; OmAvailableModel::deleteTNameRow($tName, $where); }
session_start(); header("Content-type:text/html;charset=utf-8"); date_default_timezone_set("Asia/Shanghai"); session_cache_expire(30); //session有效时间为30分钟 $tName = 'purchase_sku_conversion'; $select = '*'; $where = "WHERE 1=1"; $purchaseSkuConvertionList = OmAvailableModel::getTNameList($tName, $select, $where); if (!empty($purchaseSkuConvertionList)) { $tName = 'pc_sku_conversion'; $where = "WHERE 1=1"; OmAvailableModel::deleteTNameRow($tName, $where); } foreach ($purchaseSkuConvertionList as $value) { $id = $value['id']; $old_sku = $value['old_sku']; $new_sku = $value['new_sku']; $user = $value['user']; $createdtime = $value['createdtime']; $modifiedtime = $value['modifiedtime']; $dataConvertion = array(); $dataConvertion['id'] = $id; $dataConvertion['old_sku'] = $old_sku; $dataConvertion['new_sku'] = $new_sku; $dataConvertion['addUserId'] = getPersonIdByName($user); $dataConvertion['createdTime'] = strtotime($createdtime); $dataConvertion['modifiedUserId'] = getPersonIdByName($user); $dataConvertion['modifiedTime'] = strtotime($modifiedtime); OmAvailableModel::addTNameRow2arr($tName, $dataConvertion); }
public static function deletRecord($id_arr, $type = 0) { self::initDB(); if (!is_array($id_arr) || !is_numeric($type)) { return false; } OmAvailableModel::begin(); foreach ($id_arr as $id) { $info = self::selectList("where id={$id}"); $num = -$info[0]['num']; $sku = $info[0]['sku']; $update_tallying = "UPDATE wh_tallying_list SET is_delete=1 where id={$id}"; $update_query = self::$dbConn->query($update_tallying); if (!$update_query) { OmAvailableModel::rollback(); return false; } $update_store = self::updateStore($sku, $num); if (!$update_store) { OmAvailableModel::rollback(); return false; } if ($type == 1) { $update_group = "UPDATE wh_print_group SET is_delete=1 where tallyListId={$id}"; $query_group = self::$dbConn->query($update_group); if (!$query_group) { OmAvailableModel::rollback(); return false; } } CommonModel::checkOnWaySkuNum($sku, $info[0]['num'], 2); //去掉采购系统hold住数量 } OmAvailableModel::commit(); return true; }
public static function calcNowOrderShippingFee($omOrderId) { require_once WEB_PATH . "api/include/functions.php"; $shippingFee = 0; //初始化要返回的订单运费变量 if (intval($omOrderId) == 0) { //订单号不合法 return false; } $tName = 'om_unshipped_order'; $select = '*'; $where = "WHERE is_delete=0 AND id='{$omOrderId}'"; $omOrderList = OmAvailableModel::getTNameList($tName, $select, $where); if (empty($omOrderList)) { //没有对应订单号 return false; } $isFixed = $omOrderList[0]['isFixed']; //是最优运输方式还是固定运输方式,默认为2 $calcWeight = $omOrderList[0]['calcWeight']; //订单估算重量 $transportId = $omOrderList[0]['transportId']; //运输方式id $tName = 'om_unshipped_order_userInfo'; $select = '*'; $where = "WHERE omOrderId='{$omOrderId}'"; $omOrderUserInfoList = OmAvailableModel::getTNameList($tName, $select, $where); if (empty($omOrderUserInfoList)) { //没有对应订单号的用户信息 return false; } $countryName = $omOrderUserInfoList[0]['countryName']; //国家名称 $shipaddr = 1; //发货地址id,用来获取最优运输方式 $zipCode = $omOrderUserInfoList[0]['zipCode']; //邮编 $method = ''; //访问开放系统接口名称,最优还是固定,调用开放系统必填参数 if ($isFixed == 2) { $method = 'trans.carrier.best.get'; } else { $method = 'trans.carrier.fix.get'; } $paramArr = array('method' => $method, 'format' => 'json', 'v' => '1.0', 'username' => C('OPEN_SYS_USER')); $paramArr['carrier'] = $transportId; $paramArr['country'] = $countryName; $paramArr['weight'] = $calcWeight; $paramArr['shaddr'] = $shipaddr; $paramArr['postcode'] = $zipCode; $result = callOpenSystem($paramArr); $data = json_decode($result, true); //var_dump($data); if (empty($data['data'])) { return false; } return $data['data']; /*$data = UserCacheModel :: getOpenSysApi($method, $paramArr); if ($isFixed == 2) { return $data['data']; } else { return $data['data']; }*/ }
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'); }
function act_syncOrder() { //手动同步旧系统订单至新系统 $orderDatas = isset($_GET['orderDatas']) ? $_GET['orderDatas'] : ""; if (!$orderDatas) { self::$errCede = '002'; self::$errMsg = '参数为空!'; return false; } $orderDatas = json_decode($orderDatas, true); foreach ($orderDatas as $key => $order) { $where = "id={$order['order']['id']}"; $msg1 = OmAvailableModel::getTNameList("om_unshipped_order", "*", $where); $msg2 = OmAvailableModel::getTNameList("om_shipped_order", "*", $where); if ($msg1 || $msg2) { self::$errMsg .= "订单{$order['order']['id']}已存在!"; unset($orderDatas[$key]); } } $log_data = ''; $tablekeys = array(); $tabledatas = array(); foreach ($orderDatas as $odk => $orderD) { if (!isset($orderD['order']['orderStatus'])) { //var_dump($orderD,$orderD['order'],$orderD['order']['orderStatus']);//exit; //echo "no status{$orderD['order']['id']}\n"; } //'orderStauts'=>900, //0 //'orderType'=>21, //2 $tou = $orderD['order']['orderStatus'] == 900 && $orderD['order']['orderType'] == 21 ? 'om_shipped_' : 'om_unshipped_'; foreach ($orderD as $dk => $dataL) { if ($dk == 'orderDetail') { foreach ($dataL as $ssdata) { foreach ($ssdata as $tkey => $tdata) { //var_dump($tkey, $tdata); $tablekeys[$tou . $tkey] = array_keys($tdata); $tabledatas[$tou . $tkey][] = '(' . implode(',', _array2strarray(array_values($tdata))) . ')'; //$log_data .= "INSERT INTO {$tkey} SET "._array2sql($tdata)."\n\n"; } } } else { $tou2 = in_array($dk, array('om_order_notes', 'om_order_tracknumber')) ? '' : $tou; $tablekeys[$tou2 . $dk] = array_keys($dataL); $tabledatas[$tou2 . $dk][] = '(' . implode(',', _array2strarray(array_values($dataL))) . ')'; } } } unset($orderDatas); //echo $log_data; $sql = ''; foreach ($tablekeys as $tablen => $tablekey) { //if (empty($tabledatas[$tablen])) var_dump($tabledatas[$tablen], $tabledatas); //INSERT INTO `valsun_ordermanage`.`om_unshipped_order` (`id`, `recordNumber`, `platformId`, `accountId`, `ordersTime`, `paymentTime`, `onlineTotal`, `actualTotal`, `transportId`, `marketTime`, `ShippedTime`, `orderStatus`, `orderType`, `orderAttribute`, `pmId`, `isFixed`, `channelId`, `calcWeight`, `calcShipping`, `orderAddTime`, `isSendEmail`, `isNote`, `isCopy`, `isSplit`, `combinePackage`, `combineOrder`, `isBuji`, `isLock`, `lockUser`, `lockTime`, `storeId`, `is_delete`) VALUES (NULL, 'fds', '', '', '', '', '0.00', '0.00', '', NULL, NULL, '', NULL, '1', NULL, '2', NULL, '0.000', '0.000', '', '0', '0', '0', '0', '0', '0', '0', '0', NULL, NULL, '1', '0'); //$sql = "INSERT INTO {$tablen}(".implode(',', $tablekey).") VALUES ".implode(',', $tabledatas[$tablen]).";\n"; $key = implode(',', $tablekey); $value = implode(',', $tabledatas[$tablen]); $info = OmAvailableModel::insertRowUseValue($tablen, $key, $value); if (!$info) { self::$errMsg .= "插入订单{$tabledatas[$tablen][0]}失败!"; } } if (self::$errMsg == "") { self::$errMsg = "所选订单已插入新系统!"; self::$errCode = '200'; return true; } else { self::$errCode = '002'; return false; } /*$info = orderAddModel::syncOrder($orderDatas); if($info){ self::$errCode = orderAddModel::$errCode; self::$errMsg = orderAddModel::$errMsg; return true; }else{ self::$errCode = orderAddModel::$errCode; self::$errMsg = orderAddModel::$errMsg; return false; }*/ }
public function recordDataToSystem($data) { $number = $data['num']; $sku = mysql_real_escape_string($data['sku']); $pName = mysql_real_escape_string($data['pName']); $orderid = $data['orderid']; $orderdetailid = $data['detailid']; $amount = $data['amount']; //配货数 $totalNums = $data['totalnum']; //料号总数 $scantime = time(); $scanuserid = $data['userid']; //扫描用户id $islast = $data['islast']; $type = $data['orderTypeId']; //是否为配货单 $shiptype = $data['shiptype']; //快递类型 分国内 国外 小包 $insert_records = "\n insert into wh_order_picking_records values (null, {$orderid}, {$orderdetailid}, '{$sku}', '{$pName}', {$amount},\n {$totalNums}, {$scantime}, '{$scanuserid}', null, null, 1, 0)\n "; //插入配货记录到数据库 $update_sql = "\n update wh_sku_location set actualStock=actualStock-{$amount} where sku = '{$sku}'\n "; //更新总库存 $position_info = OmAvailableModel::getTNameList("wh_position_distribution", "id", "where pName='{$pName}' and storeId=1"); if ($position_info) { $positionId = $position_info[0]['id']; } else { return false; } $sku_info = OmAvailableModel::getTNameList("pc_goods", "id", "where sku='{$sku}'"); if ($sku_info) { $pId = $sku_info[0]['id']; } else { return false; } $update_relation_sql = "\n update wh_product_position_relation set nums=nums-{$amount} where pId = '{$pId}' and positionId='{$positionId}' and is_delete=0 and storeId=1\n "; //更新具体仓位库存 $this->dbconn->begin(); // echo $insert_records;exit; $insert_result = $this->dbconn->query($insert_records); //插入配货记录 if (!$insert_result) { $this->dbconn->rollback(); //失败 回滚 $this->dbconn->query("SET AUTOCOMMIT=1"); return false; } $update_result = $this->dbconn->query($update_sql); //更新总库存 if (!$update_result) { $this->dbconn->rollback(); //失败 回滚 $this->dbconn->query("SET AUTOCOMMIT=1"); return false; } $update_res = $this->dbconn->query($update_relation_sql); //更新实际库存 if (!$update_res) { $this->dbconn->rollback(); //失败 回滚 $this->dbconn->query("SET AUTOCOMMIT=1"); return false; } $nextstatus = 0; if (1 == $shiptype) { //快递 $nextstatus = PKS_WIQC_EX; } elseif (2 == $shiptype) { //小包 $nextstatus = PKS_WIQC; } elseif (3 == $shiptype) { //国内快递 $nextstatus = PKS_INLANDWWEIGHING; } if ($islast) { //如果是最后一个配货料号 则还需更改发货单状态 $up_status_sql = ''; $up_status_sql = 'update wh_shipping_order set orderStatus=' . $nextstatus . ' where id=' . $orderid; /* if($type==1){ //当前为发货单 $up_status_sql = 'update wh_shipping_order set orderStatus='.$nextstatus.' where id='.$orderid; } else { //当前单为配货单 $up_status_sql = 'update wh_shipping_order set orderStatus='.PKS_PDONE.' where id='.$orderid; }*/ $upst_result = $this->dbconn->query($up_status_sql); if (!$update_result) { //修改状态失败 $this->dbconn->rollback(); $this->dbconn->query("SET AUTOCOMMIT=1"); return FALSE; } } $this->dbconn->commit(); $this->dbconn->query("SET AUTOCOMMIT=1"); return TRUE; }
public function view_invList() { $now_time = date("Y-m-d H:i:s", time()); $state = isset($_GET['state']) ? post_check($_GET['state']) : ''; $this->smarty->assign('state', $state); $reason = array(); $invPeople = isset($_GET['invPeople']) ? $_GET['invPeople'] : ''; $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : ''; $invType = isset($_GET['invType']) ? $_GET['invType'] : ''; $auditStatus = isset($_GET['auditStatus']) ? $_GET['auditStatus'] : 3; $startdate = isset($_GET['startdate']) ? post_check($_GET['startdate']) : ''; $enddate = isset($_GET['enddate']) ? post_check($_GET['enddate']) : ''; $InventoryAct = new InventoryAct(); $where = 'where storeId=1 '; if ($invPeople) { $where .= "and invPeople ='{$invPeople}' "; $this->smarty->assign('invPeople', $invPeople); } if ($sku) { $where .= "and sku ='{$sku}' "; $this->smarty->assign('sku', $sku); } if ($invType) { $where .= "and invType ='{$invType}' "; $this->smarty->assign('invType', $invType); } if ($auditStatus != 3) { $where .= "and auditStatus ='{$auditStatus}' "; } $this->smarty->assign('auditStatus', $auditStatus); if ($startdate) { $starttime = strtotime($startdate); $where .= "and invTime >='{$starttime}' "; } else { $startdate = $now_time; } $this->smarty->assign('startdate', $startdate); if ($enddate) { $endtime = strtotime($enddate); $where .= "and invTime <='{$endtime}' "; } else { $enddate = $now_time; } $this->smarty->assign('enddate', $enddate); $total = $InventoryAct->act_getInvNum($where); $num = 80; //每页显示的个数 $page = new Page($total, $num, '', 'CN'); $where .= "order by sku, id " . $page->limit; $inventory_info = $InventoryAct->act_getInvRecordList('*', $where); if (!empty($_GET['page'])) { if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) { $n = 1; } else { $n = (intval($_GET['page']) - 1) * $num + 1; } } else { $n = 1; } if ($total > $num) { //输出分页显示 $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9)); } else { $show_page = $page->fpage(array(0, 2, 3)); } $this->smarty->assign('show_page', $show_page); //盘点原因 if (!empty($inventory_info)) { foreach ($inventory_info as $key => $info) { $reason_info = InvReasonModel::getInvReasonList("reasonName", "where id='{$info['reasonId']}'"); $reason[$info['id']] = $reason_info[0]['reasonName']; $sku_info = getSkuInfoBySku($info['sku']); $inventory_info[$key]['goodsCost'] = $sku_info['goodsCost']; $inventory_info[$key]['purchaseName'] = $sku_info['purchaseId'] ? getUserNameById($sku_info['purchaseId']) : '无'; $inventory_info[$key]['remark'] = $info['remark'] ? $info['remark'] : ''; //新增等待上架数量 add by Gary $tallyList = OmAvailableModel::getTNameList('wh_tallying_list', 'sum(ichibanNums) ichibanNums, sum(shelvesNums) shelvesNums', "where sku='{$info['sku']}' and tallyStatus=0 and is_delete = 0"); $ichibanNums = intval($tallyList[0]['ichibanNums']); $shelvesNums = intval($tallyList[0]['shelvesNums']); $inventory_info[$key]['wait_whself'] = $ichibanNums - $shelvesNums; } } $usermodel = UserModel::getInstance(); //盘点员 $iqc_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job in(162,165)", '', ''); $this->smarty->assign('iqc_user', $iqc_user); $this->smarty->assign('inventory_info', $inventory_info ? $inventory_info : array()); $this->smarty->assign('reason', $reason); $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '仓库'), array('url' => 'index.php?mod=inventory&act=inventory', 'title' => '盘点管理'), array('url' => 'index.php?mod=inventory&act=invList', 'title' => '盘点列表')); $toplevel = 0; //一级菜单的序号 0 开始 $this->smarty->assign('toplevel', $toplevel); $secondlevel = 04; //当前的二级菜单 $this->smarty->assign('secondlevel', $secondlevel); $this->smarty->assign('navlist', $navlist); $this->smarty->assign('toptitle', '盘点列表'); $this->smarty->assign('curusername', $_SESSION['userName']); $this->smarty->display('inventoryInfo.htm'); }
} $detail_blag = false; foreach ($order_detail as $detail) { $insert_detail_arr = array(); $insert_detail_arr[] = "shipOrderId = '{$shipOrderId}'"; $insert_detail_arr[] = "sku = '{$detail['sku']}'"; $insert_detail_arr[] = "amount = '{$detail['amount']}'"; $insert_detail_arr[] = "positionId = '{$detail['positionId']}'"; $insert_detail_arr[] = "pName = '{$detail['pName']}'"; $detail_tname = "wh_shipping_orderdetail"; $detail_set = "set " . implode(",", $insert_tracknumber_arr); $detailId = OmAvailableModel::addTNameRow($detail_tname, $detail_set); if (!$detailId) { Log::write("INSERT INTO " . $detail_tname . $detail_set, Log::ERR); OmAvailableModel::rollback(); $detail_blag = true; break; } } if ($detail_blag) { continue; } OmAvailableModel::commit(); $channel->basic_ack($msg->delivery_info['delivery_tag']); } } } $i++; } $channel->close(); $connection->close();
foreach ($v as $v0) { $sku_price += $v0['real_price']; $qty += $v0['qty']; } //$fedex_remark['ebay_ordersn'] = $order['ebay_ordersn']; $fedex_remark['price'] = round($sku_price / $qty, 2); $fedex_remark['amount'] = $qty; $fedex_remark['hamcodes'] = $v[0]['hamcodes']; if ($carrierList[$orderdata['transportId']] == 'DHL' || $carrierList[$orderdata['transportId']] == 'EMS') { $fedex_remark['price'] = round($sku_price, 2); } $fedex_remark['createdTime'] = time(); $fedex_remark['omOrderId'] = $omOrderId; $fedex_remark['creatorId'] = 253; //$insert_fedex_sql = "INSERT INTO fedex_remark set ".array2sql($fedex_remark); $info = OmAvailableModel::insertRow("om_express_remark", " set " . array2sql($fedex_remark)); if ($info) { //echo "----<font color=green> {$order['recordnumber']} 导入海关记录成功!</font><br>"; } else { //echo $insert_fedex_sql; echo "<br>"; //echo "----<font color=red>{$order['recordnumber']} 导入海关记录失败!</font><br>"; $fail_order[] = $orderdata['recordnumber']; } } //echo "订单".$ebay_id."抓取成功!<br>"; //baseModel::commit(); } if ($val['ACK'] != "Success") { if ($val['Errors']['ShortMessage'] != "") { echo "orderdetails ShortMessage:" . $val['Errors']['ShortMessage'] . "\n"; }
session_cache_expire(30); //session有效时间为30分钟 $fileName = "/data/htdocs/zhuqingting.dev.com/pc.valsun.cn/html/excel/noCZCatetroy" . date("Y-m-d_H_i_s") . ".xls"; $propertyName = '材质'; $tName = 'pc_archive_property'; $select = 'categoryPath'; $where = "WHERE propertyName='{$propertyName}' group by categoryPath"; $ppList = OmAvailableModel::getTNameList($tName, $select, $where); $haveCZArr = array(); foreach ($ppList as $value) { $haveCZArr[] = $value['categoryPath']; } $tName = 'pc_goods_category'; $select = 'path'; $where = "WHERE is_delete=0"; $pathList = OmAvailableModel::getTNameList($tName, $select, $where); $excel = new ExportDataExcel('file'); $excel->filename = $fileName; $excel->initialize(); $excel->addRow(array('无材质属性类别')); foreach ($pathList as $value) { $tName = 'pc_goods_category'; $where = "WHERE path like'{$value['path']}-%' and is_delete=0"; $count = OmAvailableModel::getTNameCount($tName, $where); if (!in_array($value['path'], $haveCZArr) && !$count) { $categoryName = getAllCateNameByPath($value['path']); $excel->addRow(array($categoryName)); //echo $value['path']."\n"; } } $excel->finalize();
public function act_packingTracknumber() { $orderid = isset($_POST['orderid']) ? $_POST['orderid'] : ""; $tracknumber = isset($_POST['tracknumber']) ? $_POST['tracknumber'] : ""; $userId = $_SESSION['userId']; //先核对订单 //兼容 EUB或者 包裹 扫描的是 trackno 而非ebayid $p_real_ebayid = '#^\\d+$#'; $p_trackno_eub = '#^(LK|RA|RB|RC|RR|RF|LN)\\d+(CN|HK|DE200)$#'; $is_eub_package_type = false; if (preg_match($p_real_ebayid, $orderid)) { } else { if (preg_match($p_trackno_eub, $orderid)) { $is_eub_package_type = true; } else { self::$errCode = "001"; self::$errMsg = "订单号[" . $orderid . "]格式有误"; return false; } } if ($is_eub_package_type === true) { $record = ShippingOrderModel::getShippingOrderInfo("b.*", "where a.tracknumber='{$orderid}' and a.is_delete=0"); } else { $record = ShippingOrderModel::getShippingOrder("*", "where id='{$orderid}'"); } //验证发货单号 以及所属状态 if (!$record) { self::$errCode = 404; self::$errMsg = "发货单号不存在!"; return false; } if ($record[0]['orderStatus'] != 404) { self::$errCode = 405; self::$errMsg = "此发货单不在待包装!"; if ($record[0]['orderStatus'] == 900) { self::$errMsg = "此发货单已废弃!"; } return false; } //挂号的单需要再输入挂号条码 $carrier = CommonModel::getShipingNameById($record[0]['transportId']); $partion = CommonModel::getChannelNameByIds($record[0]['transportId'], $record[0]['countryName']); $total_num = 0; $skuinfos = get_realskunum($record[0]['id']); foreach ($skuinfos as $or_sku => $or_nums) { $total_num += $or_nums; } if (carrier == '中国邮政挂号' && !preg_match("/^(RA|RB|RC|RR)\\d+(CN)\$/", $tracknumber)) { self::$errCode = 111; self::$errMsg = "录入失败,中国邮政挂号跟踪码不符合规范"; return false; } if ($carrier == '香港小包挂号' && !preg_match("/^(RA|RB|RC|RR)\\d+(HK)\$/", $tracknumber)) { self::$errCode = 111; self::$errMsg = "录入失败,香港小包挂号跟踪码不符合规范"; return false; } $p_str = "挂号条码:" . "<font color='#FF0000'>" . $tracknumber . "</font> <br>"; TransactionBaseModel::begin(); //更新订单状态 $msg = OmAvailableModel::updateTNameRow("wh_shipping_order", "set orderStatus=405", "where id={$record[0]['id']}"); if (!$msg) { self::$errCode = 409; self::$errMsg = "更新发货单状态记录失败!"; $arr['partion'] = $partion; $arr['carrier'] = $carrier; TransactionBaseModel::rollback(); return json_encode($arr); exit; } //更新操作记录 $msg = packingScanOrderModel::updateOrderRecord($record[0]['id'], $userId); if (!$msg) { self::$errCode = 406; self::$errMsg = "更新发货单操作记录失败!"; TransactionBaseModel::rollback(); return false; } //插入包装记录 $msg = packingScanOrderModel::insertPackingRecord($record[0]['id'], $userId); if (!$msg) { self::$errCode = 407; self::$errMsg = "插入包装记录失败!"; TransactionBaseModel::rollback(); return false; } $msg = packingScanOrderModel::deleteTrackRecord($record[0]['id']); if (!$msg) { self::$errCode = 409; self::$errMsg = "删除跟踪记录失败!"; TransactionBaseModel::rollback(); return false; } //录入挂号条码 $msg = packingScanOrderModel::insertTrackRecord($tracknumber, $record[0]['id']); if (!$msg) { self::$errCode = 408; self::$errMsg = "插入包装记录失败!"; TransactionBaseModel::rollback(); return false; } WhPushModel::pushOrderStatus($record[0]['id'], 'STATESHIPPED_BEWEIGHED', $userId, time(), '', $tracknumber); //状态推送 $arr['partion'] = "<font color='#FF0000'>该订单属于" . $partion . ";含SKU总数:" . $total_num . "个</font><br>"; $arr['carrier'] = $carrier; $arr['res'] = $arr['partion'] . "包装人员:" . "<font color='green'>" . $_SESSION['userCnName'] . "</font><br>" . "运输方式:" . "<font color='#FF0000'>" . $carrier . "</font> <br>" . $p_str . "扫描结果:<font color='#33CC33'>包装扫描成功!</font>"; TransactionBaseModel::commit(); return $arr; }
public function act_manualSortingCheck() { $userId = $_SESSION['userId']; $waveId = isset($_POST['waveId']) ? $_POST['waveId'] : ""; $where = "number='{$waveId}'"; $waveInfo = WhWaveInfoModel::get_wave_info("*", $where); if (!$waveInfo) { self::$errCode = 502; self::$errMsg = "此配货单号不存在!"; return false; } if ($waveInfo[0]['waveStatus'] != WAVE_FINISH_GET_GOODS) { self::$errCode = 514; self::$errMsg = "此配货单不在【配货完成】状态,不能进行分拣操作!"; return false; } if ($waveInfo[0]['waveType'] == 3) { self::$errCode = 518; self::$errMsg = "此配货单属于多SKU生成的配货单,不能进行人工分拣!"; return false; } //一个发货单对应多个配货单的时候,发货单是唯一的, if ($waveInfo[0]['waveType'] == 1) { $waveId = $waveInfo[0]['id']; $result = WhWaveShippingRelationModel::select_not_scanning($waveId); $shipOrderId = $result[0]['shipOrderId']; if ($result[0]['pickUserId'] != 0) { self::$errCode = 520; self::$errMsg = "此配货单已经分拣过了!"; return false; } WhShippingOrderModel::begin(); $update = WhWaveShippingRelationModel::update(array('pickUserId' => $userId, 'pickTime' => time()), array('is_delete' => 0, 'waveId' => $waveId)); if (!$update) { self::$errCode = 519; self::$errMsg = "扫描该配货单失败,请联系负责人!"; WhShippingOrderModel::rollback(); return false; // $result = WhWaveShippingRelationModel::getShippingOrderIdsByWaveId($waveId); //$shipOrderId = $result[0]['shipOrderId']; //查询还没有扫描的配货单 } $select_not_scanning = WhWaveShippingRelationModel::select_not_scanning_by_id($shipOrderId); $not_scanning_waveId = ''; //还没有分拣的配货单 if ($select_not_scanning) { foreach ($select_not_scanning as $val) { $not_scanning_waveId .= $val['waveId'] . ','; } self::$errMsg = "扫描该配货单'{$waveId}'成功,对应发货单'{$shipOrderId}'的配货单'{$not_scanning_waveId}'还没有分拣!"; } else { self::$errMsg = "扫描该配货单'{$waveId}'成功,对应的发货单'{$shipOrderId}'已经分拣完成,请处理完成之后拿去复核!"; //获取一个发货单对应多个配货单的每个配货单号 $result = OmAvailableModel::getTNameList("wh_wave_shipping_relation", "waveId", "where shipOrderId='{$shipOrderId}' and is_delete=0 "); $wave_all = ''; foreach ($result as $values) { $wave_all .= $values['waveId'] . ','; } $wave_all = trim($wave_all, ','); //得到该发货单下所有配货单的信息 $scan_record = OmAvailableModel::getTNameList("wh_wave_scan_record", "waveId,sku,skuAmount,amount", "where waveId in ('{$wave_all}') and scanStatus = 1 and is_delete=0 "); $picklist_all = array(); foreach ($scan_record as $record) { $data = array('waveId' => $record['waveId'], 'shipOrderId' => $shipOrderId, 'sku' => $record['sku'], 'skuAmount' => $record['skuAmount'], 'amount' => $record['amount'], 'pickStatus' => 1, 'pickUserId' => intval($_SESSION['userId']), 'pickTime' => time(), 'deleteUserId' => '0', 'deleteTime' => '0', 'is_delete' => '0'); $picklist_all[] = $data; } if (!WhWavePickRecordModel::insert($picklist_all, true)) { WhShippingOrderModel::rollback(); self::$errCode = 517; self::$errMsg = "该配货单插入分拣记录失败!"; return false; } $where = "id = '{$shipOrderId}' AND orderStatus='" . PKS_WAITING_SORTING . "'"; if (!WhShippingOrderModel::update_shipping_order($where, "orderStatus='" . PKS_WIQC . "'")) { WhShippingOrderModel::rollback(); self::$errCode = 516; self::$errMsg = "此配货单所属发货单{$shipOrderId}更新状态失败!"; return false; } } WhPushModel::pushOrderStatus($shipOrderId, 'PKS_WIQC', $_SESSION['userId'], time()); //状态推送,需要改为待复核单(订单系统提供状态常量) WhShippingOrderModel::commit(); self::$errCode = 200; return true; } /* if(empty($waveInfo[0]['sku'])){ self::$errCode = 515; self::$errMsg = "此配货单不属于单SKU生成的配货单,不能进行人工分拣!"; return false; } */ $waveId = $waveInfo[0]['id']; //echo $waveId; $shippOrders = WhWaveShippingRelationModel::getShippingOrderIdsByWaveId($waveId); //var_dump($shippOrders); WhShippingOrderModel::begin(); foreach ($shippOrders as $shippOrder) { $shipOrderId = $shippOrder['shipOrderId']; $where = "id = '{$shipOrderId}' AND orderStatus='" . PKS_WAITING_SORTING . "'"; if (!WhShippingOrderModel::update_shipping_order($where, "orderStatus='" . PKS_WIQC . "'")) { WhShippingOrderModel::rollback(); self::$errCode = 516; self::$errMsg = "此配货单所属发货单{$shipOrderId}更新状态失败!"; return false; } } $pick = WhWavePickRecordModel::find("waveId='{$waveId}'"); if (!$pick) { $picklist = array(); $list = WhShippingOrderdetailModel::getShippingOrderSkuList($waveId); foreach ($list as $val) { $data = array('waveId' => $val['waveId'], 'shipOrderId' => $val['shipOrderId'], 'sku' => $val['sku'], 'skuAmount' => $val['amount'], 'amount' => 0, 'pickStatus' => 1, 'pickUserId' => intval($_SESSION['userId']), 'pickTime' => time(), 'deleteUserId' => '0', 'deleteTime' => '0', 'is_delete' => '0'); $picklist[] = $data; } if (!WhWavePickRecordModel::insert($picklist, true)) { WhShippingOrderModel::rollback(); self::$errCode = 517; self::$errMsg = "该配货单插入分拣记录失败!"; return false; } else { foreach ($picklist as $lists) { WhPushModel::pushOrderStatus($lists['shipOrderId'], 'PKS_WIQC', $_SESSION['userId'], time()); //状态推送,需要改为待复核单(订单系统提供状态常量) } } } WhShippingOrderModel::commit(); self::$errCode = 200; self::$errMsg = "该配货单分拣成功,请处理完成之后拿去复核!"; return true; }
function act_allPass() { $userCnName = $_SESSION['userCnName']; $id_arr = $_POST['id']; $f_count = count($id_arr); $id = implode(',', $id_arr); $where = "where id in(" . $id . ") and auditStatus=0"; $record_list = InvRecordModel::getInvRecordList("*", $where); $s_count = count($record_list); if ($f_count != $s_count) { self::$errCode = "401"; self::$errMsg = "当前包含有不用审核的订单,请确认!"; return false; } OmAvailableModel::begin(); foreach ($record_list as $record) { $data = array(); $id = $record['id']; $data = array('auditStatus' => 1); $Inv_info = InvRecordModel::getInvRecordList("*", "where id='{$id}'"); $position_info = OmAvailableModel::getTNameList("wh_position_distribution", "id", "where pName='{$Inv_info[0]['location']}'"); $skuinfo = whShelfModel::selectSku(" where sku='{$Inv_info[0]['sku']}'"); $updatedata = InvRecordModel::update($data, "and id='{$id}'"); if (!$updatedata) { self::$errCode = "402"; self::$errMsg = "更新通过状态失败!"; return false; } $tName = 'wh_product_position_relation'; $set = "SET nums='{$Inv_info[0]['invNums']}'"; $where = "WHERE pId='{$skuinfo['id']}' AND positionId='{$position_info[0]['id']}' AND is_delete=0 AND storeId=1"; $affectRow = OmAvailableModel::updateTNameRow($tName, $set, $where); //库存变化 if ($affectRow === false) { self::$errCode = "403"; self::$errMsg = "更新具体仓位库存失败!"; OmAvailableModel::rollback(); return false; } $adjustNums = $Inv_info[0]['adjustNums']; if ($Inv_info[0]['invType'] == 2) { $adjustNums = "-" . $adjustNums; } $tName = 'wh_sku_location'; $set = "SET actualStock=actualStock+'{$adjustNums}'"; $where = "WHERE sku='{$Inv_info[0]['sku']}' AND storeId=1"; $affectRow = WhIoRecordsModel::updateTNameRow($tName, $set, $where); //库存变化 if ($affectRow === false) { self::$errCode = "404"; self::$errMsg = "更新总库存失败!"; OmAvailableModel::rollback(); return false; } /**** 插入出入库记录 *****/ if ($Inv_info[0]['invType'] == 2) { $ioType = 1; $ioTypeId = 11; $reason = '盘点出库'; } else { $ioType = 2; $ioTypeId = 10; $reason = '盘点入库'; } if ($adjustNums != 0) { $update_onhand = CommonModel::adjustInventory($Inv_info[0]['sku'], $adjustNums, $userCnName); if ($update_onhand == 0) { self::$errCode = 415; self::$errMsg = "更新旧erp库存失败"; OmAvailableModel::rollback(); return false; } $skuinfo = whShelfModel::selectSku(" where sku = '{$Inv_info[0]['sku']}'"); $paraArr = array('sku' => $Inv_info[0]['sku'], 'amount' => abs($adjustNums), 'positionId' => $position_info[0]['id'], 'purchaseId' => $skuinfo['purchaseId'], 'ioType' => $ioType, 'ioTypeId' => $ioTypeId, 'userId' => $_SESSION['userId'], 'reason' => $reason); $record = CommonModel::addIoRecores($paraArr); //出库记录 if (!$record) { OmAvailableModel::rollback(); return false; } } //更新申请盘点表 $waitInf = WaitInventoryModel::updateInv($Inv_info[0]['sku'], $_SESSION['userId']); if (!$waitInf) { self::$errCode = 414; self::$errMsg = "跟新申请盘点表失败!"; TransactionBaseModel::rollback(); return false; } } OmAvailableModel::commit(); return true; }
function rollback() { OmAvailableModel::rollback(); }
public static function auto_contrast_intercept($orderData) { global $SYSTEM_ACCOUNTS, $__liquid_items_fenmocsku, $__liquid_items_BuiltinBattery, $__liquid_items_SuperSpecific, $__liquid_items_Paste; global $GLOBAL_EBAY_ACCOUNT; global $express_delivery, $no_express_delivery; if (!$SYSTEM_ACCOUNTS) { $__liquid_items_array = PurchaseAPIModel::getAdjustransportFromPurchase(); //var_dump($__liquid_items_array); //echo time(); echo "<br>"; $__liquid_items_postbyhkpost = array_filter(explode(",", $__liquid_items_array['液体产品'])); //液体产品 $__liquid_items_postbyfedex = array_filter(explode(",", $__liquid_items_array['贵重产品'])); //贵重物品走联邦 $__liquid_items_cptohkpost = array_filter(explode(",", $__liquid_items_array['指甲油产品'])); //指甲油转香港小包 $__liquid_items_elecsku = array_filter(explode(",", $__liquid_items_array['电子类产品'])); //电子类产品走香港小包 //$__elecsku_countrycn_array = array_filter(explode(",", $__liquid_items_array['']));//电子类产品指定国家 $__liquid_items_fenmocsku = array_filter(explode(",", $__liquid_items_array['粉末状产品'])); //粉末状SKU $__liquid_items_BuiltinBattery = array_filter(explode(",", $__liquid_items_array['内置电池产品'])); //内置电池类产品 $__liquid_items_SuperSpecific = array('6471', '14995'); //超规格的产品,长度大于60cm, 三边大于 90cm $__liquid_items_Paste = array_filter(explode(",", $__liquid_items_array['膏状产品'])); //膏状SKU*/ $__liquid_items_elecWithoutBattery = array_filter(explode(",", $__liquid_items_array['电子类【不带电池】'])); //电子类【不带电池】*/ $__liquid_items_OutWeight = array_filter(explode(",", $__liquid_items_array['超重产品>=1.9kg'])); //超重产品>=1.9kg*/ //取统一包装材料重量数据 //$MaterInfo = CommonModel::getMaterInfo(); //取统一国家中文名对应英文名 /*$ec = "select * from ebay_countrys where ebay_user='******' "; $result = $dbConn->execute($ec); $ebay_country_lists = $dbConn->getResultArray($result); $global_countrycn_coutryen = array(); foreach($ebay_country_lists AS $ebay_country_list){ $global_countrycn_coutryen[trim($ebay_country_list['countryen'])] = trim($ebay_country_list['countrycn']); }*/ //取各个平台的账号名称 $SYSTEM_ACCOUNTS = OmAvailableModel::getPlatformAccount(); //echo "<pre>";print_r($SYSTEM_ACCOUNTS); $express_delivery = array(); $express_delivery_value = array(); $no_express_delivery = array(); $no_express_delivery_value = array(); $express_delivery_value = CommonModel::getCarrierListById(1); /*foreach($express_delivery_arr as $value){ $express_delivery_value[$value['id']] = $value['carrierNameCn']; }*/ $express_delivery = array_keys($express_delivery_value); //var_dump($express_delivery); $no_express_delivery_value = CommonModel::getCarrierListById(0); /*foreach($no_express_delivery_arr as $value){ $no_express_delivery_value[$value['id']] = $value['carrierNameCn']; }*/ $no_express_delivery = array_keys($no_express_delivery_value); } if (!$GLOBAL_EBAY_ACCOUNT) { $GLOBAL_EBAY_ACCOUNT = array(); foreach ($SYSTEM_ACCOUNTS as $acct) { foreach ($acct as $key => $value) { $GLOBAL_EBAY_ACCOUNT[$key] = $value; } } } //var_dump($GLOBAL_EBAY_ACCOUNT);exit; self::initDB(); //var_dump($orderData); echo "\n"; $log_data = ""; $actualTotal0 = 0; //该订单实际总数 //$ebay_id = $orderData['orderData']['id']; $orderStatus = empty($orderData['orderData']['orderStatus']) ? C('STATEPENDING') : $orderData['orderData']['orderStatus']; $orderType = empty($orderData['orderData']['orderType']) ? C('STATEPENDING_CONV') : $orderData['orderData']['orderType']; $returnStatus = array('orderStatus' => $orderStatus, 'orderType' => $orderType); $isNote = $orderData['orderData']['isNote']; if ($isNote) { $orderType = C('STATEPENDING_MSG'); } $calcWeight = $orderData['orderData']['calcWeight']; $pmId = $orderData['orderData']['pmId']; //var_dump($calcWeight); echo "\n"; $orderdetaillist = $orderData['orderDetail']; if (empty($calcWeight)) { $calcInfo = CommonModel::calcAddOrderWeight($orderdetaillist); //计算重量和包材 $calcWeight = $calcInfo[0]; $pmId = $calcInfo[1]; $orderData['orderData']['calcWeight'] = $calcWeight; $orderData['orderData']['pmId'] = $pmId; } //var_dump($calcWeight); echo "\n"; $transportId = @$orderData['orderData']['transportId']; $countryName = $orderData['orderUserInfoData']['countryName']; $accountId = $orderData['orderData']['accountId']; $actualTotal = $orderData['orderData']['actualTotal']; $ebay_username = $orderData['orderUserInfoData']['username']; $orderDataid = $orderData['orderExtenData']['orderId']; $ebay_usermail = $orderData['orderUserInfoData']['email']; $PayPalEmailAddress = @$orderData['orderExtenData']['PayPalEmailAddress']; //echo "------$countryName-----\n"; //echo "订单计算重量:$calcWeight\t\n"; $contain_special_item = false; $contain_os_item = false; $ow_status = array(); //foreach ($orderdetaillist AS $orderdetail){ for ($i = 0; $i < count($orderdetaillist); $i++) { $sku = $orderdetaillist[$i]['orderDetailData']['sku']; $itemPrice = $orderdetaillist[$i]['orderDetailData']['itemPrice']; $amount = $orderdetaillist[$i]['orderDetailData']['amount']; $shippingFee = $orderdetaillist[$i]['orderDetailData']['shippingFee']; //var_dump($sku); $sku_arr = GoodsModel::get_realskuinfo($sku); //var_dump($sku_arr); exit; $actualTotal0 += $itemPrice * $amount + $shippingFee; foreach ($sku_arr as $or_sku => $or_nums) { if (in_array($or_sku, $__liquid_items_fenmocsku) || in_array($or_sku, $__liquid_items_SuperSpecific) || in_array($or_sku, $__liquid_items_BuiltinBattery)) { //粉末状,超规格产品 走福建邮局 $contain_special_item = true; } if (preg_match("/^US01\\+.*/", $or_sku, $matchArr) || preg_match("/^US1\\+.*/", $or_sku, $matchArr)) { //$log_data .= "[".date("Y-m-d H:i:s")."]\t包含海外仓料号订单---{$ebay_id}-----料号:{$or_sku}--!\n\n"; $contain_os_item = true; if (strpos($or_sku, "US01+") !== false) { $matchStr = substr($matchArr[0], 5); //去除前面 //$matchStr = str_replace("US1+", "", $or_sku); } else { //$matchStr=substr($matchArr[0],5);//去除前面 $matchStr = str_replace("US1+", "", $or_sku); } $n = strpos($matchStr, ':'); //寻找位置 if ($n) { $matchStr = substr($matchStr, 0, $n); } //删除后面 if (preg_match("/^0+(\\w+)/", $matchStr, $matchArr)) { $matchStr = $matchArr[1]; } $orderData['orderDetail'][$i]['orderDetailData']['sku'] = $matchStr; //OrderAddModel::updateDetailExtension(array('sku'=>$matchStr), " id = {$orderdetail['ebay_id']} "); //$virtualnum = check_oversea_stock($matchStr); //检查海外仓虚拟库存 $virtualnum = 1; //预留获取海外仓虚拟库存接口 20131225 if ($virtualnum >= 0) { $ow_status[] = C('STATEPENDING_OVERSEA'); //海外仓待处理 } else { $ow_status[] = C('STATEOUTOFSTOCK_OVERSEA'); //海外仓缺货 } } } } if ($contain_special_item) { /*$sql = "update ebay_order set ebay_carrierstyle ='1' where ebay_id ={$ebay_id}"; //add by Herman.Xi 记录该订单含有特殊料号 $dbConnn->query($sql); $log_data .= "[".date("Y-m-d H:i:s")."]\t包含粉末状超规格产品---{$ebay_id}---!\n\n";*/ } if ($contain_os_item) { if (in_array(C('STATEOUTOFSTOCK_OVERSEA'), $ow_status)) { $orderData['orderData']['orderStatus'] = C('STATEPENDING_OS'); $orderData['orderData']['orderType'] = C('STATEOUTOFSTOCK_OVERSEA'); } else { $orderData['orderData']['orderStatus'] = C('STATEPENDING_OS'); $orderData['orderData']['orderType'] = C('STATEPENDING_OVERSEA'); } //$log_data .= "[".date("Y-m-d H:i:s")."]\t更新海外仓料号订单状态为{$final_status}---{$ebay_id}--{$sql}-!\n\n"; /*if($final_status == C('STATEPENDING_OVERSEA')){ $calcWeight = calcWeight($ebay_id); $skunums = checkSkuNum($ebay_id); if($skunums === true){ continue; }else if ($calcWeight>20) { if($skunums==1){ usCalcShipCost($ebay_id); } } else { usCalcShipCost($ebay_id); } }*/ //$calcWeight = recalcorderweight($order_sn, $ebay_packingmaterial); //modified by Herman.Xi 2012-10-17 $log_data .= "[" . date("Y-m-d H:i:s") . "]\t包含海外仓料号---自动跳转---的状态为---{$final_status}!\n\n"; CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; //continue; } $interceptrtn = self::intercept_exception_orders($orderData); //var_dump($interceptrtn); if ($interceptrtn) { $orderData['orderData']['orderStatus'] = $interceptrtn['orderStatus']; $orderData['orderData']['orderType'] = $interceptrtn['orderType']; $log_data .= "[" . date("Y-m-d H:i:s") . "]\t自动跳转的状态为--" . $orderStatus . "--" . $orderType . "!\n\n"; CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; } $record_details = array(); $is_640 = false; //var_dump($orderdetaillist); exit; foreach ($orderdetaillist as $orderdetail) { //var_dump($orderdetail['sku']); $sku = $orderdetail['orderDetailData']['sku']; //$itemPrice = $orderdetail['orderDetailData']['itemPrice']; $amount = $orderdetail['orderDetailData']['amount']; //$shippingFee = $orderdetail['orderDetailData']['shippingFee']; $sku_arr = GoodsModel::get_realskuinfo($sku); //var_dump($sku_arr); exit; $hava_goodscount = true; foreach ($sku_arr as $or_sku => $or_nums) { $allnums = $or_nums * $amount; if (!CommonModel::check_sku($or_sku, $allnums)) { //超大订单状态 $orderStatus = C('STATEOVERSIZEDORDERS'); if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['aliexpress']) || in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['DHgate']) || in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['出口通']) || in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['线下结算客户'])) { $orderType = C('STATEOVERSIZEDORDERS_CONFIRM'); } else { $orderType = C('STATEOVERSIZEDORDERS_PEND'); } //self::insert_mark_shipping($ebay_id); $is_640 = true; break; } else { $skuinfo = CommonModel::get_sku_info($or_sku); $salensend = CommonModel::getpartsaleandnosendall($or_sku); //$log_data .= "[".date("Y-m-d H:i:s")."]\t---{$sql}\n\n"; $log_data .= "订单==={$ebay_id}===料号=={$or_sku}===实际库存为{$skuinfo['realnums']}===需求量为{$allnums}===待发货数量为{$salensend}===\n"; if (!isset($skuinfo['realnums']) || empty($skuinfo['realnums']) || $skuinfo['realnums'] - $salensend - $allnums < 0) { $hava_goodscount = false; break; } } } if ($hava_goodscount) { $record_details[] = $orderdetail; } } if ($is_640) { $orderData['orderData']['orderStatus'] = $orderStatus; $orderData['orderData']['orderType'] = $orderType; //$returnStatus = array('orderStatus'=>$orderStatus, 'orderType'=>$orderType); $log_data .= "[" . date("Y-m-d H:i:s") . "]\t自动跳转的状态为--" . $orderStatus . "--" . $orderType . "!\n\n"; CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; } $count_record_details = count($record_details); $count_orderdetaillist = count($orderdetaillist); $final_status = $orderStatus; //原始状态 if ($count_record_details == 0) { //更新至自动拦截发货状态 /*if (!in_array($ebay_carrier, $no_express_delivery)){ $final_status = 658; }else { $final_status = 661; }*/ //$sql = "UPDATE ebay_order SET ebay_status='$final_status' WHERE ebay_id ='$ebay_id' and ebay_status = '{$orderStatus}' "; $orderStatus = C('STATEOUTOFSTOCK'); $orderType = C('STATEOUTOFSTOCK_AO'); //$log_data .= "[".date("Y-m-d H:i:s")."]\t自动跳转的状态为---".C('STATEOUTOFSTOCK_AO')."!\n\n"; //self::insert_mark_shipping($ebay_id); //self::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); //$returnStatus = array('orderStatus'=>$orderStatus, 'orderType'=>$orderType); $orderData['orderData']['orderStatus'] = $orderStatus; $orderData['orderData']['orderType'] = $orderType; $log_data .= "[" . date("Y-m-d H:i:s") . "]\t自动跳转的状态为--" . $orderStatus . "--" . $orderType . "!\n\n"; CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; } else { if ($count_record_details < $count_orderdetaillist) { //更新至自动部分发货状态 /*if (!in_array($ebay_carrier, $no_express_delivery)){ //$final_status = 659; $final_status = 640; }else { $final_status = 660; }*/ $orderStatus = C('STATEOUTOFSTOCK'); $orderType = C('STATEOUTOFSTOCK_PO'); //$log_data .= "[".date("Y-m-d H:i:s")."]\t自动跳转的状态为---".C('STATEOUTOFSTOCK_PO')."!\n\n"; //self::insert_mark_shipping($ebay_id); //$returnStatus = array('orderStatus'=>C('STATEOUTOFSTOCK'), 'orderType'=>C('STATEOUTOFSTOCK_PO')); //self::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); //$returnStatus = array('orderStatus'=>$orderStatus, 'orderType'=>$orderType); $orderData['orderData']['orderStatus'] = $orderStatus; $orderData['orderData']['orderType'] = $orderType; $log_data .= "[" . date("Y-m-d H:i:s") . "]\t自动跳转的状态为--" . $orderStatus . "--" . $orderType . "!\n\n"; CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; } else { if ($count_record_details == $count_orderdetaillist) { //正常发货状态 if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['ebay'])) { if (in_array($orderStatus, array(C('STATEOUTOFSTOCK_PO'), C('STATEOUTOFSTOCK_PO')))) { //$final_status = 618;//ebay订单自动拦截有货不能移动到待处理和有留言 modified by Herman.Xi @ 20130325(移动到缺货需打印中) $orderStatus = C('STATEPENDING'); if ($isNote == 1) { echo "有留言\t"; $orderType = C('STATEPENDING_MSG'); } else { $orderType = C('STATEPENDING_HASARRIVED'); } } else { $orderStatus = C('STATEPENDING'); if ($isNote == 1) { echo "有留言\t"; $orderType = C('STATEPENDING_MSG'); } else { $orderType = C('STATEPENDING_CONV'); } } } else { if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['aliexpress'])) { if (in_array($countryName, array('Russian Federation', 'Russia')) && strpos($ebay_carrier, '中国邮政') !== false && str_word_count($ebay_username) < 2) { $orderStatus = C('STATESYNCINTERCEPT'); $orderType = C('STATESYNCINTERCEPT_AB'); $orderData['orderData']['orderStatus'] = $orderStatus; $orderData['orderData']['orderType'] = $orderType; $log_data .= "[" . date("Y-m-d H:i:s") . "]\t自动跳转的状态为--" . $orderStatus . "--" . $orderType . "!\n\n"; CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; } } else { if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['DHgate'])) { $orderStatus = C('STATEPENDING'); $orderType = C('STATEPENDING_CONV'); } else { if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['dresslink.com'])) { $orderStatus = C('STATEPENDING'); $orderType = C('STATEPENDING_CONV'); } else { if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['cndirect.com'])) { $orderStatus = C('STATEPENDING'); $orderType = C('STATEPENDING_CONV'); } else { if (in_array($GLOBAL_EBAY_ACCOUNT[$accountId], $SYSTEM_ACCOUNTS['Amazon'])) { $orderStatus = C('STATEPENDING'); $orderType = C('STATEPENDING_CONV'); } else { $orderStatus = C('STATEPENDING'); $orderType = C('STATEPENDING_CONV'); } } } } } } if ($isNote == 1) { echo "有留言\t"; $orderType = C('STATEPENDING_MSG'); } /*if(self::judge_contain_combinesku_new($orderdetaillist)){ $final_status = 606; }*/ if ($calcWeight > 2) { echo "\t 超重订单"; $orderStatus = C('STATEPENDING'); $orderType = C('STATEPENDING_OW'); } $expressArr = CommonModel::getCarrierInfoById(1); if (in_array($transportId, $expressArr)) { $orderType = C('STATEPENDING_HASARRIVED'); } /*if (!in_array($ebay_carrier, $no_express_delivery) && !empty($ebay_carrier)){ if(in_array($GLOBAL_EBAY_ACCOUNT[$accountId],$SYSTEM_ACCOUNTS['ebay']) || in_array($GLOBAL_EBAY_ACCOUNT[$accountId],$SYSTEM_ACCOUNTS['海外销售平台'])){ $final_status = 641;//ebay和海外都跳转到 待打印线下和异常订单 }else{ $final_status = 639; } }*/ } else { $log_data .= "[" . date("Y-m-d H:i:s") . "]\t订单同步状态有误,请联系IT解决!"; } } } //$returnStatus = array('orderStatus'=>$orderStatus, 'orderType'=>$orderType); $orderData['orderData']['orderStatus'] = $orderStatus; $orderData['orderData']['orderType'] = $orderType; $log_data .= "[" . date("Y-m-d H:i:s") . "]\t自动跳转的状态为--" . $orderStatus . "--" . $orderType . "!\n\n"; //print_r($GLOBAL_EBAY_ACCOUNT); CommonModel::write_scripts_log('auto_contrast_intercept', $GLOBAL_EBAY_ACCOUNT[$accountId], $log_data); return $orderData; }
$__liquid_items_elecWithoutBattery = array_filter(explode(",", $__liquid_items_array['电子类【不带电池】'])); //电子类【不带电池】*/ $__liquid_items_OutWeight = array_filter(explode(",", $__liquid_items_array['超重产品>=1.9kg'])); //超重产品>=1.9kg*/ //取统一包装材料重量数据 //$MaterInfo = CommonModel::getMaterInfo(); //取统一国家中文名对应英文名 /*$ec = "select * from ebay_countrys where ebay_user='******' "; $result = $dbConn->execute($ec); $ebay_country_lists = $dbConn->getResultArray($result); $global_countrycn_coutryen = array(); foreach($ebay_country_lists AS $ebay_country_list){ $global_countrycn_coutryen[trim($ebay_country_list['countryen'])] = trim($ebay_country_list['countrycn']); }*/ //取各个平台的账号名称 $SYSTEM_ACCOUNTS = OmAvailableModel::getPlatformAccount(); //echo "<pre>";print_r($SYSTEM_ACCOUNTS); $express_delivery = array(); $express_delivery_value = array(); $no_express_delivery = array(); $no_express_delivery_value = array(); $express_delivery_value = CommonModel::getCarrierListById(1); /*foreach($express_delivery_arr as $value){ $express_delivery_value[$value['id']] = $value['carrierNameCn']; }*/ $express_delivery = array_keys($express_delivery_value); //var_dump($express_delivery); $no_express_delivery_value = CommonModel::getCarrierListById(0); /*foreach($no_express_delivery_arr as $value){ $no_express_delivery_value[$value['id']] = $value['carrierNameCn']; }*/