本文整理匯總了PHP中Prefs::getOutlet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Prefs::getOutlet方法的具體用法?PHP Prefs::getOutlet怎麽用?PHP Prefs::getOutlet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Prefs
的用法示例。
在下文中一共展示了Prefs::getOutlet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeUpdateForm
public function beforeUpdateForm($population)
{
//print_r($population);
//exit();
foreach (Prefs::getOutlet()->OutletToArray() as $o) {
$av = Stockunit::where('outletId', $o->_id)->where('productId', new MongoId($population['_id']))->where('status', 'available')->count();
$hd = Stockunit::where('outletId', $o->_id)->where('productId', new MongoId($population['_id']))->where('status', 'hold')->count();
$rsv = Stockunit::where('outletId', $o->_id)->where('productId', new MongoId($population['_id']))->where('status', 'reserved')->count();
$sld = Stockunit::where('outletId', $o->_id)->where('productId', new MongoId($population['_id']))->where('status', 'sold')->count();
$population['stocks'][$o->_id]['available'] = $av;
$population['stocks'][$o->_id]['hold'] = $hd;
$population['stocks'][$o->_id]['reserved'] = $rsv;
$population['stocks'][$o->_id]['sold'] = $sld;
}
if (!isset($population['full_url'])) {
$population['full_url'] = $population['large_url'];
}
return $population;
}
示例2: postAssignoutlet
public function postAssignoutlet()
{
$in = Input::get();
$category = $in['outlet'];
$cats = Prefs::getOutlet()->OutletToSelection('name', '_id', false);
//print_r($cats);
$product_ids = $in['product_ids'];
foreach ($product_ids as $p) {
$prop = Stockunit::find($p);
$prop->outletId = $cats[$category];
$prop->outletName = $category;
$prop->save();
}
return Response::json(array('result' => 'OK'));
}