本文整理汇总了PHP中Appointment::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Appointment::count方法的具体用法?PHP Appointment::count怎么用?PHP Appointment::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appointment
的用法示例。
在下文中一共展示了Appointment::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manage
/**
* @before _secure, _vendor
*/
public function manage($duration = '')
{
$this->JSONview();
$view = $this->getActionView();
if ($this->member->designation == "admin") {
$where = array("organization_id = ?" => $this->member->organization_id);
} else {
$where = array("centre_id = ?" => $this->member->centre_id);
}
switch ($duration) {
case 'month':
$month = strftime("%Y-%m-%d", strtotime('-30 Days'));
$where["created > ?"] = $month;
break;
case 'agendaWeek':
$week = strftime("%Y-%m-%d", strtotime('-7 Days'));
$where["created > ?"] = $week;
break;
case 'agendaDay':
$day = strftime("%Y-%m-%d", strtotime('-1 Day'));
$where["created > ?"] = $day;
break;
}
$count = Appointment::count($where);
$view->set("count", $count);
}
示例2: index
/**
* @before _secure
*/
public function index()
{
$this->seo(array("title" => "Appointments Scheduled", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$appointments = array();
$page = RequestMethods::get("page", 1);
$limit = RequestMethods::get("limit", 10);
$count = Appointment::count(array("user_id" => $this->user->id));
$as = Appointment::all(array("user_id =?" => $this->user->id, "live = ?" => 1), array("id", "service_id", "start", "end", "patient_id"), "start", "asc", $limit, $page);
foreach ($as as $a) {
$service = Service::first(array("id = ?" => $a->service_id), array("property", "property_id", "organization_id", "charge"));
$organization = Organization::first(array("id = ?" => $service->organization_id), array("id", "name"));
$model = ucfirst($service->property);
$item = $model::first(array("id = ?" => $service->property_id), array("title"));
$patient = User::first(array("id = ?" => $a->patient_id), array("name"));
array_push($appointments, array("item" => $item->title, "organization_id" => $organization->id, "organization_name" => $organization->name, "patient" => $patient->name, "start" => $a->start, "end" => $a->end, "id" => $a->id, "charge" => $service->charge));
}
$view->set("appointments", $appointments);
$view->set("page", $page);
$view->set("limit", $limit);
$view->set("count", $count);
}
示例3: appointments
/**
* @before _secure, _doctor
*/
public function appointments()
{
$this->seo(array("title" => "My Appointments", "view" => $this->getLayoutView()));
$this->getLayoutView()->set("cal", true);
$view = $this->getActionView();
$appointments = array();
$page = RequestMethods::get("page", 1);
$limit = RequestMethods::get("limit", 10);
$count = Appointment::count(array("user_id" => $this->user->id));
$as = Appointment::all(array("user_id =?" => $this->user->id, "live = ?" => 1), array("id", "service_id", "start", "end", "patient_id"), "start", "asc", $limit, $page);
foreach ($as as $a) {
$service = Service::first(array("id = ?" => $a->service_id), array("property", "property_id", "organization_id", "charge"));
$organization = Organization::first(array("id = ?" => $service->organization_id), array("id", "name"));
$model = ucfirst($service->property);
$item = $model::first(array("id = ?" => $service->property_id), array("title"));
$patient = User::first(array("id = ?" => $a->patient_id), array("name"));
array_push($appointments, array("item" => $item->title, "organization_id" => $organization->id, "organization_name" => $organization->name, "patient" => $patient->name, "start" => $a->start, "end" => $a->end, "id" => $a->id, "charge" => $service->charge));
}
$organization = Registry::get("session")->get("organization");
if (RequestMethods::post("action") == "capacity") {
\Slot::saveRecord($this->user, $organization);
$view->set("message", "Slots Saved Successfully");
}
$view->set("appointments", $appointments);
$days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
$view->set("days", $days);
$view->set("slots", Shared\Services\Doctor::slots($this->user));
}