当前位置: 首页>>代码示例>>PHP>>正文


PHP Carbon::startOfDay方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:37,代码来源:ParticipantController.php


注:本文中的Carbon::startOfDay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。