當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OmAvailableModel::getTNameList方法代碼示例

本文整理匯總了PHP中OmAvailableModel::getTNameList方法的典型用法代碼示例。如果您正苦於以下問題:PHP OmAvailableModel::getTNameList方法的具體用法?PHP OmAvailableModel::getTNameList怎麽用?PHP OmAvailableModel::getTNameList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OmAvailableModel的用法示例。


在下文中一共展示了OmAvailableModel::getTNameList方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: orderLog

 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;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:27,代碼來源:orderLog.model.php

示例2: act_accountList

 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;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:7,代碼來源:accountManage.action.php

示例3: act_autoCreateSpu

 function act_autoCreateSpu()
 {
     $data = array();
     $prefix = trim($_POST['prefix']);
     if (!preg_match("/^[A-Z]{2}\$/", $prefix)) {
         self::$errCode = 11;
         self::$errMsg = 'error';
         return false;
     }
     $prefixList = OmAvailableModel::getTNameList('pc_auto_create_spu_prefix', 'isSingSpu', "WHERE prefix='{$prefix}'");
     $isSingSpu = $prefixList[0]['isSingSpu'];
     //該prefix下試單還是虛擬料號
     $autoSpuList = OmAvailableModel::getTNameList('pc_auto_create_spu', 'sort', "WHERE spu REGEXP '^{$prefix}[0-9]{6}\$' order by sort desc limit 1");
     $maxNumberAuto = $autoSpuList[0]['sort'];
     //auto表中最大的max
     $maxNumberTrue = OmAvailableModel::getMaxSpu($prefix, $isSingSpu);
     //對應goods表或combine表中最大的max
     $maxNumber = $maxNumberTrue > $maxNumberAuto ? $maxNumberTrue : $maxNumberAuto;
     //return $maxNumberTrue;
     //$maxNumber = OmAvailableModel::getMaxSpu($prefix, $isSingSpu);
     $spu = $prefix . str_pad($maxNumber + 1, 6, '0', STR_PAD_LEFT);
     $data = array('spu' => $spu, 'sort' => $maxNumber + 1, 'prefix' => $prefix, 'isSingSpu' => $isSingSpu);
     if (!empty($data)) {
         return $data;
     } else {
         self::$errCode = 1;
         self::$errMsg = 'error';
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:30,代碼來源:spu.action.php

示例4: act_postsku

 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;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:54,代碼來源:wrapperSkuOut.action.php

示例5: act_index

 public function act_index()
 {
     $platformId = $_REQUEST['platformId'];
     $account = OmAvailableModel::getTNameList('om_account', 'id,platformId,account', 'WHERE is_delete=0 AND platformId = ' . $platformId);
     if ($account) {
         return $account;
     } else {
         self::$errCode = '300';
         self::$errMsg = '無法獲得對應平台用戶名信息';
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:12,代碼來源:omBlackList.action.php

示例6: act_getTNameList

 function act_getTNameList($tName, $set, $where)
 {
     //表名,SET,WHERE
     $list = OmAvailableModel::getTNameList($tName, $set, $where);
     if (is_array($list)) {
         return $list;
     } else {
         self::$errCode = OmAvailableModel::$errCode;
         self::$errMsg = OmAvailableModel::$errMsg;
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:12,代碼來源:omAvailable.action.php

示例7: view_skuInfo

 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");
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:48,代碼來源:skuInfo.view.php

示例8: act_getTNameList

 function act_getTNameList()
 {
     $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'];
     //表名
     $select = $jsonArr['select'];
     //select,不用關鍵字SELECT
     $where = $jsonArr['where'];
     //where,要帶上關鍵字WHERE
     if (empty($tName) || empty($select) || empty($where)) {
         self::$errCode = '300';
         self::$errMsg = '必要參數不完整';
         return false;
     }
     $list = OmAvailableModel::getTNameList($tName, $select, $where);
     if (is_array($list)) {
         self::$errCode = '200';
         self::$errMsg = '成功';
         return $list;
     } else {
         self::$errCode = '404';
         self::$errMsg = '數據庫操作錯誤';
         return false;
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:38,代碼來源:omAvailableApi.action.php

示例9: act_pda_ExpressId

 /**
  * 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;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:43,代碼來源:pda_ExpressWeighing.action.php

示例10: act_getSkuId

 function act_getSkuId($sku)
 {
     $field = ' id ';
     $where = " where sku = '{$sku}' limit 0,1 ";
     $result = OmAvailableModel::getTNameList('ph_goods', $field, $where);
     return $result[0]['id'];
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:7,代碼來源:goods.action.php

示例11: act_updateBatchForSalers

 /**
  *功能:我自己運行的接口,批量更新數據,根據需求批量更新銷售是陳智興的虛擬料號,將其銷售人員改為對應真實SPU的銷售人員
  * */
 public function act_updateBatchForSalers()
 {
     $tName = 'pc_spu_saler_combine';
     $select = 'spu';
     $where = "WHERE is_delete=0 and platformId=2 and isAgree=2 and salerId=60";
     $combineSpuList = OmAvailableModel::getTNameList($tName, $select, $where);
     foreach ($combineSpuList as $value) {
         $combineSpu = $value['spu'];
         $tName = 'pc_goods_combine';
         $select = 'combineSku';
         $where = "WHERE is_delete=0 and combineSpu='{$combineSpu}'";
         $combineSkuList = OmAvailableModel::getTNameList($tName, $select, $where);
         if (!empty($combineSkuList)) {
             $tName = 'pc_sku_combine_relation';
             $select = 'sku';
             $where = "WHERE combineSku='{$combineSkuList[0]['combineSku']}'";
             $skuList = OmAvailableModel::getTNameList($tName, $select, $where);
             if (!empty($skuList)) {
                 $tName = 'pc_goods';
                 $select = 'spu';
                 $where = "WHERE is_delete=0 and sku='{$skuList[0]['sku']}'";
                 $spuList = OmAvailableModel::getTNameList($tName, $select, $where);
                 if (!empty($spuList)) {
                     $tName = 'pc_spu_saler_single';
                     $select = 'salerId';
                     $where = "WHERE is_delete=0 and platformId=2 and isAgree=2 and spu='{$spuList[0]['spu']}'";
                     $singleSpuSalerIdList = OmAvailableModel::getTNameList($tName, $select, $where);
                     if (!empty($singleSpuSalerIdList)) {
                         $salerId = $singleSpuSalerIdList[0]['salerId'];
                         $saler = getPersonNameById($salerId);
                         $tName = 'pc_spu_saler_combine';
                         $where = "WHERE is_delete=0 and spu='{$combineSpu}'";
                         $dataArr = array();
                         $dataArr['salerId'] = $salerId;
                         OmAvailableModel::updateTNameRow2arr($tName, $dataArr, $where);
                         echo "{$combineSpu} 的原銷售是 陳智興,真實銷售是 {$saler} <br />";
                     } else {
                         echo "{$combineSpu} 的原銷售是 陳智興,真實銷售為空 <br />";
                     }
                 }
             }
         }
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:47,代碼來源:omAvailableApi.action.php

示例12: session_start

<?php

require_once "/data/web/erpNew/pc.valsun.cn/framework.php";
Core::getInstance();
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);
開發者ID:ohjack,項目名稱:newErp,代碼行數:31,代碼來源:getLocationSkuConvertionToPcSkuConvertion.php

示例13: calcNowOrderShippingFee

 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'];
     		}*/
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:64,代碼來源:common.model.php

示例14: view_printGroupOrder2

 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='{$userName}',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');
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:77,代碼來源:printOrder.view.php

示例15: act_manualSortingCheck

 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'];
//.........這裏部分代碼省略.........
開發者ID:ohjack,項目名稱:newErp,代碼行數:101,代碼來源:whManualSorting.action.php


注:本文中的OmAvailableModel::getTNameList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。