本文整理匯總了PHP中Registration::has方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registration::has方法的具體用法?PHP Registration::has怎麽用?PHP Registration::has使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Registration
的用法示例。
在下文中一共展示了Registration::has方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isRegistrable
/**
* (1) user_list 為空才開放注冊
* (2) 注冊截止比賽結束時
* (3) 隻能注冊一次
*/
public function isRegistrable()
{
if (strlen(trim($this->getUserList())) > 0) {
return FALSE;
}
if ($this->getEndDatetime()->lt(new fTimestamp())) {
return FALSE;
}
if (Registration::has(fAuthorization::getUserToken(), $this->getId())) {
return FALSE;
}
return TRUE;
}
示例2: elseif
<?php
if (fAuthorization::checkLoggedIn() and Registration::has(fAuthorization::getUserToken(), $this->report->getId())) {
?>
<button class="btn btn-mini btn-success disabled">已確認參賽</button>
<?php
} elseif ($this->report->isRegistrable()) {
?>
<form style="display:inline;margin:0" action="<?php
echo SITE_BASE;
?>
/contest/<?php
echo $this->report->getId();
?>
/register" method="POST">
<button type="submit" class="btn btn-mini btn-success">確認參賽</button>
</form>
<?php
}
示例3: purchaseCost
public function purchaseCost($id)
{
$registration = Registration::has('issue')->find($id);
$earning = new Earning();
$earning->project_id = $registration->project_id;
$earning->location_id = $registration->location_id;
$earning->issue_id = $registration->issue->id;
$earning->employee_id = Auth::user()->employee_id;
$earning->earning_date = $registration->registration_date;
$earning->earnable_type = 'Registration';
$earning->earnable_id = $registration->id;
$earning->code = $this->generateEarningCode();
$earning->signature = $this->generateEarningSignature();
$earning->payment = $registration->registration_cost;
$earning->save();
$registration->cost_is_paid = 1;
$registration->save();
return array('code' => $earning->code);
}
示例4: registrationsFilter
public function registrationsFilter($id)
{
$classification_id = $id;
$classification = Classification::find($classification_id);
$classifications = Classification::where('category', '=', 'Registration')->get();
$registrations = Registration::has('issue')->where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('classification_id', '=', $classification_id)->get();
$menu = 'report';
return View::make('reports.registrations', compact('classifications', 'classification', 'registrations', 'menu'));
}