本文整理匯總了PHP中CommonModel::getGoodsCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::getGoodsCount方法的具體用法?PHP CommonModel::getGoodsCount怎麽用?PHP CommonModel::getGoodsCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonModel
的用法示例。
在下文中一共展示了CommonModel::getGoodsCount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: act_checkSkuPositon
function act_checkSkuPositon()
{
$sku = post_check(trim($_POST['sku']));
$sku = get_goodsSn($sku);
$location = post_check(trim($_POST['location']));
$where = " where sku = '{$sku}'";
$skuinfo = whShelfModel::selectSku($where);
if (empty($skuinfo)) {
self::$errCode = 401;
self::$errMsg = "無該料號信息";
return false;
} else {
$skuId = $skuinfo['id'];
}
$sku_positon_list = InvRecordModel::getSkuPosition($skuId, $location);
if (empty($sku_positon_list)) {
self::$errCode = 402;
self::$errMsg = "料號和倉位信息有誤";
return false;
} else {
$sku_num = CommonModel::getGoodsCount($sku);
self::$errMsg = "請輸入盤點數量,選擇盤點原因";
return $sku_num;
}
}
示例2: process_sku
/**
* WhGoodsAssignAct::process_sku()
* 處理停售料號
* @return
*/
function process_sku($skus)
{
$log_file = 'clearSkuLocation/' . date('Y-m-d') . '.txt';
$skus = array_filter($skus);
//處理料號數組
if (empty($skus)) {
return FALSE;
}
$num_arr = array();
//庫存不為空料號
$is_sale = array();
//非停售料號
$sucess = array();
//清空成功料號
$fail = array();
//清空失敗料號
//print_r($skus);exit;
foreach ($skus as $sku) {
$goods_count = CommonModel::getGoodsCount($sku);
//獲取舊ERP庫存
if ($goods_count !== FALSE && $goods_count != 0) {
//庫存非零情況
$num_arr[$sku] = $goods_count;
continue;
}
$sku_info = packageCheckModel::selectSku($sku);
//獲取料號信息
if (!in_array($sku_info[0]['goodsStatus'], array(2, 3))) {
$is_sale[] = $sku;
continue;
}
TransactionBaseModel::begin();
//清空料號倉位
$info = whShelfModel::clearSkuLocation($sku_info[0]['id']);
$date = date('Y-m-d H:i:s');
if ($info == TRUE) {
$log_info = sprintf("料號:%s, 時間:%s, 信息:%s \r\n", $sku, $date, '新係統倉位清空成功');
write_log($log_file, $log_info);
} else {
$log_info = sprintf("料號:%s, 時間:%s, 信息:%s \r\n", $sku, $date, '新係統倉位清空失敗');
write_log($log_file, $log_info);
$fail[] = $sku;
continue;
}
//同步清除老ERP倉位
$info = CommonModel::clearSkuLocation($sku);
//接口
if ($info['errCode'] == 200) {
$log_info = sprintf("料號:%s, 時間:%s, 信息:%s,返回值:%s \r\n", $sku, $date, '老ERP倉位清空成功', is_array($info) ? json_encode($info) : $info);
write_log($log_file, $log_info);
$sucess[] = $sku;
} else {
$log_info = sprintf("料號:%s, 時間:%s, 信息:%s,返回值:%s \r\n", $sku, $date, '老ERP倉位清空失敗', is_array($info) ? json_encode($info) : $info);
write_log($log_file, $log_info);
$fail[] = $sku;
TransactionBaseModel::rollback();
continue;
}
TransactionBaseModel::commit();
}
return array('num_arr' => $num_arr, 'is_sale' => $is_sale, 'sucess' => $sucess, 'fail' => $fail);
}