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