本文整理汇总了PHP中Carbon::startOfDay方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::startOfDay方法的具体用法?PHP Carbon::startOfDay怎么用?PHP Carbon::startOfDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carbon
的用法示例。
在下文中一共展示了Carbon::startOfDay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doPaymentSelect
public function doPaymentSelect($id)
{
$user = Auth::user();
$member = Member::find($id);
$title = 'League Together - ' . $member->team->club->name . ' Teams';
$type = Input::get('type');
$club = Club::find($member->team->club->id);
switch ($type) {
case 'full':
$price = $member->getOriginal('due');
$today = Carbon::Now();
$early = new Carbon($member->early_due_deadline);
if ($member->early_due_deadline) {
if ($today->startOfDay() <= $early->startOfDay()) {
$price = $member->getOriginal('early_due');
}
}
$item = array('id' => $member->team->id, 'name' => "Membership Team " . $member->team->name, 'price' => $price, 'quantity' => 1, 'organization' => $member->team->club->name, 'organization_id' => $member->team->club->id, 'member_id' => $member->id, 'player_id' => $member->player->id, 'user_id' => $user->id, 'type' => $type, 'autopay' => false);
Cart::insert($item);
foreach (Cart::contents() as $item) {
$item->name = "Membership Team " . $member->team->name;
$item->quantity = 1;
}
return Redirect::action('MemberController@paymentCreate', array($member->id));
case 'plan':
$price = $member->plan->getOriginal('initial');
$item = array('id' => $member->team->id, 'name' => "Membership Team " . $member->team->name, 'price' => $price, 'quantity' => 1, 'organization' => $member->team->club->name, 'organization_id' => $member->team->club->id, 'member_id' => $member->id, 'player_id' => $member->player->id, 'user_id' => $user->id, 'type' => $type, 'autopay' => false);
Cart::insert($item);
foreach (Cart::contents() as $item) {
$item->name = "Membership Team " . $member->team->name;
$item->quantity = 1;
}
return Redirect::action('MemberController@paymentCreate', array($member->id));
default:
return Redirect::action('MemberController@paymentSelect', array($member->id))->with('error', 'Opps we are having some trouble processing your request, please try later. Error# 345');
}
}