本文整理汇总了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'));
}