本文整理匯總了PHP中CommonModel::getPurchaseList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::getPurchaseList方法的具體用法?PHP CommonModel::getPurchaseList怎麽用?PHP CommonModel::getPurchaseList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonModel
的用法示例。
在下文中一共展示了CommonModel::getPurchaseList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actGetPurchaseList
/**
* CommonAct::actGetPurchaseList()
* 獲取公司采購列表
* @param int $all 是否全部獲取 true全部獲取
* @return array
*/
public static function actGetPurchaseList($all = false)
{
$cacheName = md5("purchase_list");
$memc_obj = new Cache(C('CACHEGROUP'));
$purchaseInfo = $memc_obj->get_extral($cacheName);
if (!empty($purchaseInfo)) {
$purchaseInfo = unserialize($purchaseInfo);
} else {
$purchaseInfo = CommonModel::getPurchaseList();
$isok = $memc_obj->set_extral($cacheName, serialize($purchaseInfo));
if (!$isok) {
self::$errCode = 0;
self::$errMsg = 'memcache緩存出錯!';
//return false;
}
}
if ($all) {
return $purchaseInfo;
exit;
}
//獲取當前用戶可見采購帳號
$res = CommonAct::actGetPurchaseAccess();
if (empty($res['power_ids'])) {
$uids = isset($_SESSION[C('USER_AUTH_SYS_ID')]) ? $_SESSION[C('USER_AUTH_SYS_ID')] : 0;
} else {
$uids = $res['power_ids'];
}
if (empty($uids)) {
self::$errCode = 10001;
self::$errMsg = '您還尚未登錄!';
return false;
}
//獲取可見采購的帳號信息
$uidArr = explode(",", $uids);
$realArr = array();
foreach ($uidArr as $v) {
foreach ($purchaseInfo as $key => $val) {
if ($val['userId'] == $v) {
array_push($realArr, array("userId" => $val['userId'], "userName" => $val['userName']));
break;
}
}
}
return $realArr;
}
示例2: view_showPackage
public function view_showPackage()
{
$navlist = array(array('url' => '', 'title' => '庫存管理'), array('url' => '', 'title' => '點貨清單'));
$toplevel = 0;
$secondlevel = 03;
$checkUser = isset($_GET['checkUser']) ? $_GET['checkUser'] : "";
$purchase = isset($_GET['purchase']) ? $_GET['purchase'] : "";
$sku = isset($_GET['sku']) ? $_GET['sku'] : "";
$status = isset($_GET['status']) ? $_GET['status'] : 3;
$start = isset($_GET['startdate']) ? $_GET['startdate'] : "";
$end = isset($_GET['enddate']) ? $_GET['enddate'] : "";
$this->smarty->assign('navlist', $navlist);
$this->smarty->assign('toplevel', $toplevel);
$this->smarty->assign('secondlevel', $secondlevel);
if (empty($checkUser) && empty($purchase) && empty($sku) && empty($start) && empty($end) && $status == 200) {
$where = "where is_delete=0";
} else {
if (!empty($checkUser)) {
$where[] = "tallyUserId='{$checkUser}'";
$this->smarty->assign("tallyUserId", $checkUser);
}
if (!empty($purchase)) {
$where[] = "purchaseId='{$purchase}'";
$this->smarty->assign("purchase", $purchase);
}
if (!empty($sku)) {
$where[] = "sku = '{$sku}'";
$this->smarty->assign("sku", $sku);
}
if ($status != 200) {
$where[] = "entryStatus = '{$status}'";
$this->smarty->assign("status", $status);
}
if (!empty($start) && !empty($end)) {
$starttime = strtotime($start);
$endtime = strtotime($end);
$where[] = "(entryTime between {$starttime} and {$endtime})";
$this->smarty->assign("start", $start);
$this->smarty->assign("end", $end);
} elseif (!empty($start) && empty($end)) {
$starttime = strtotime($start);
$where[] = "entryTime >{$starttime}";
$this->smarty->assign("start", $start);
} elseif (empty($start) && !empty($end)) {
$endtime = strtotime($end);
$where[] = "entryTime < {$endtime}";
$this->smarty->assign("end", $end);
}
$where = implode(" AND ", $where);
$where = " where is_delete=0 and " . $where;
}
$where = $where . ' order by id desc';
$nums = packageCheckModel::getTotalNums($where);
$pagesize = 50;
//$nums = count($lists);
$pager = new Page($nums, $pagesize);
$lists = packageCheckModel::selectList($where . " " . $pager->limit);
if ($nums > $pagesize) {
//分頁
$pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
} else {
$pagestr = $pager->fpage(array(0, 2, 3));
}
$userList = packageCheckModel::selectUser();
$usermodel = UserModel::getInstance();
foreach ($lists as $key => $list) {
//到貨庫存
$sku_arrival = OmAvailableModel::getTNameList("wh_sku_location", "arrivalInventory", "where sku='{$list['sku']}'");
$lists[$key]['arrivalInventory'] = $sku_arrival[0]['arrivalInventory'];
//獲取原始點貨數量
$before_num = OmAvailableModel::getTNameList("wh_tallying_adjustment", "beforeNum", "where tallyListId='{$list['id']}' order by id asc limit 1");
$lists[$key]['before_num'] = empty($before_num) ? $list['num'] : $before_num[0]['beforeNum'];
}
//點貨員
$tallyUser = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=209", '', '');
$this->smarty->assign('tallyUser', $tallyUser);
//采購員
$purchaseList = CommonModel::getPurchaseList();
$this->smarty->assign('purchaseList', $purchaseList);
/** 添加貼標時間、QC檢測時間、上架時間 add by GARY(yym)**/
$this->smarty->registerPlugin('function', 'getSkuTime', 'getSkuTime');
//$this->smarty->registerPlugin('function','getSkuInputTime','getSkuInputTime');
/** end**/
$toptitle = '點貨清單列表';
//頂部鏈接
$this->smarty->assign('toptitle', $toptitle);
$this->smarty->assign('pagestr', $pagestr);
$this->smarty->assign("lists", $lists);
$this->smarty->display('packageCheckList1.htm');
}