本文整理匯總了PHP中OmAvailableModel::getSkuPositions方法的典型用法代碼示例。如果您正苦於以下問題:PHP OmAvailableModel::getSkuPositions方法的具體用法?PHP OmAvailableModel::getSkuPositions怎麽用?PHP OmAvailableModel::getSkuPositions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OmAvailableModel
的用法示例。
在下文中一共展示了OmAvailableModel::getSkuPositions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: act_getSkuPositions
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;
}
}
示例2: act_addWhIoStoreDetailInWh
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;
}
}