function act_getSkuPositions() { $sku = isset($_GET['sku']) ? trim($_GET['sku']) : ''; $storeId = isset($_GET['storeId']) ? intval($_GET['storeId']) : 1; if (empty($sku)) { //参数不完整 self::$errCode = 101; self::$errMsg = '参数信息不完整'; return false; } $sku_info = OmAvailableModel::getSkuPositions($sku, $storeId); if ($sku_info) { return json_encode($sku_info); } else { self::$errCode = 102; self::$errMsg = '找不到对应sku的仓位信息'; return false; } }
function act_addWhIoStoreDetailInWh() { //$jsonArr为参数数组,包含的键值如下 $jsonArr = $_REQUEST['jsonArr']; $jsonArr = json_decode($jsonArr, true); if (empty($jsonArr)) { self::$errCode = 0101; self::$errMsg = 'empty jsonArr'; return 0; } if (!is_array($jsonArr)) { self::$errCode = 0201; self::$errMsg = 'error array'; return 0; } $iostoreId = $jsonArr['iostoreId']; //出入库单据编号(id) $sku = $jsonArr['sku']; //添加的sku $amount = $jsonArr['amount']; //对应数量 $cost = $jsonArr['cost']; //成本 $purchaseId = $jsonArr['purchaseId']; //采购员id $storeId = $jsonArr['whId']; $positionId = OmAvailableModel::getSkuPositions($sku, $storeId); //仓位ID if (empty($iostoreId)) { //出入库单据的id不能为空 self::$errCode = 0301; self::$errMsg = 'empty iostoreId'; return 0; } if (empty($sku)) { self::$errCode = 0401; self::$errMsg = 'empty sku'; return 0; } if (empty($amount)) { self::$errCode = 0501; self::$errMsg = 'empty amount'; return 0; } if (empty($cost)) { self::$errCode = 0601; self::$errMsg = 'empty cost'; return 0; } if (empty($purchaseId)) { //默认公司为1赛维 self::$errCode = 0701; self::$errMsg = 'empty purchaseId'; return 0; } $tName = 'wh_iostoredetail'; $set = "SET iostoreId='{$iostoreId}',sku='{$sku}',amount='{$amount}',cost='{$cost}',purchaseId='{$purchaseId}',positionId='{$positionId}' "; $affectRows = WhIoStoreModel::addTNameRow($tName, $set); if (!$affectRows) { self::$errCode = 00; self::$errMsg = 'addRow error'; return 0; } else { self::$errCode = 200; self::$errMsg = 'success'; return $affectRows; } }