本文整理汇总了PHP中Manager::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::all方法的具体用法?PHP Manager::all怎么用?PHP Manager::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dashboard
public function dashboard()
{
$manager = Manager::all();
$avg = array();
foreach ($manager as $key => $man) {
$avg[$key] = DB::select('SELECT AVG(percentage) as avg FROM (SELECT (SUM(t.access)/(count(*))*100) as percentage, a.id as aid,t.tool_name, a.manager_id as mid,a.account_name as aname,m.manager as Manager FROM accounts a JOIN managers m ON(m.id = a.manager_id) JOIN tools t ON(t.acc_id = a.id) where m.id = ' . $manager[$key]->id . ' group by (t.acc_id)) as mavg');
}
$colors = array('0' => 'primary', '1' => 'red', '2' => 'green', '3' => 'yellow');
return View::make('admin._main', compact('manager', 'colors', 'avg'));
}
示例2: intercept
public static function intercept($path, $type = 'file', $debug = false)
{
$modules = Manager::all();
foreach ($modules as $module) {
$m_path = $module->path();
if (false !== strpos($path, ptc_path('root') . '/app/config')) {
continue;
// do nothing
} else {
if (false !== strpos($path, ptc_path('root') . '/app') && false === strpos($path, $m_path)) {
$file = str_replace(ptc_path('root') . '/app', $m_path, $path);
if ('realpath' === $type && ($f = realpath($file))) {
$path = $f;
break;
// load the first file found
} else {
if ('file' === $type && file_exists($file)) {
if ($debug) {
ptc_log([$file, $path], 'StreamWrapper intercepted module file!', 'StreamWrapper Config');
}
$path = $file;
break;
// load the first file found
}
}
}
}
}
return $path;
}
示例3: session
protected function session()
{
$session = Registry::get("session");
$managers = Manager::all(array("user_id = ?" => $this->user->id));
if ($managers) {
$session->set("managing", $managers);
$this->redirect("/admin");
}
$member = Member::first(array("user_id = ?" => $this->user->id));
$doc = Doc::first(array("user_id = ?" => $this->user->id));
if ($member && !$doc) {
$organization = Organization::first(array("id = ?" => $member->organization_id));
$session->set("member", $member);
$session->set("organization", $organization);
$this->redirect("/vendor");
}
if ($doc && $member) {
$organization = Organization::first(array("id = ?" => $member->organization_id));
$session->set("member", $member);
$session->set("organization", $organization);
$session->set("doctor", $doc);
$this->redirect("/doctor");
}
$checkout = isset($_COOKIE["__hlCheckout"]) ? true : false;
if ($checkout) {
setcookie("__hlCheckout", "", time() - 3600);
$this->redirect("/cart/checkout");
}
$this->redirect("/patient.html");
}