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


PHP Participant::Find方法代码示例

本文整理汇总了PHP中Participant::Find方法的典型用法代码示例。如果您正苦于以下问题:PHP Participant::Find方法的具体用法?PHP Participant::Find怎么用?PHP Participant::Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Participant的用法示例。


在下文中一共展示了Participant::Find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($participant)
 {
     $user = Auth::user();
     $club = $user->clubs()->FirstOrFail();
     $participant = Participant::Find($participant);
     $player = Player::Find($participant->player_id);
     $event = Evento::find($participant->event->id);
     // $payment = Payment::find($payment);
     $title = 'League Together - ' . $event->name . ' Event';
     return View::make('app.club.event.participant.delete')->with('page_title', $title)->withEvent($event)->withClub($club)->withPlayer($player)->with('participant', $participant)->withUser($user);
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:11,代码来源:ParticipantController.php

示例2: doRefund

 public function doRefund($id)
 {
     $user = Auth::user();
     $club = $user->clubs()->FirstOrFail();
     $uuid = Uuid::generate();
     $payment = Payment::where('club_id', '=', $club->id)->where('transaction', '=', $id)->FirstOrFail();
     $user_parent = User::find($payment->user_id);
     $uuid = Uuid::generate();
     if ($payment->event_type) {
         $participant = Participant::Find($payment->items->first()->participant_id);
         $event = Evento::find($participant->event->id);
     } else {
         $participant = Member::Find($payment->items->first()->member_id);
         $event = Team::find($participant->team->id);
     }
     $player = Player::Find($participant->player->id);
     //$amount = $payment->getOriginal('subtotal');
     $amount = Input::get('amount');
     if ($amount > $payment->getOriginal('subtotal')) {
         return Redirect::action('AccountingController@refund', $payment->transaction)->with('error', "You cannot refund more than " . $payment->getOriginal('subtotal'));
     }
     if ($amount <= 0 || $amount == '') {
         return Redirect::action('AccountingController@refund', $payment->transaction)->with('error', "Amount must be more than 0");
     }
     if ($amount > 0) {
         $param = array('transactionid' => $payment->transaction, 'club' => $club->id, 'amount' => number_format($amount, 2, ".", ""));
         $transaction = $payment->refund($param);
         if ($transaction->response == 3 || $transaction->response == 2) {
             return Response::json($transaction);
             return Redirect::action('AccountingController@transaction', $payment->transaction)->with('error', $transaction->responsetext);
         } else {
             $payment1 = new Payment();
             $payment1->id = $uuid;
             $payment1->customer = $user_parent->profile->customer_vault;
             $payment1->transaction = $transaction->transactionid;
             $payment1->subtotal = -$transaction->total;
             $payment1->total = -$transaction->total;
             $payment1->club_id = $club->id;
             $payment1->user_id = $user_parent->id;
             $payment1->player_id = $player->id;
             $payment1->type = $transaction->type;
             $sale = new Item();
             $sale->description = $event->name . " ({$transaction->type})";
             $sale->quantity = 1;
             $sale->price = -$transaction->total;
             $sale->payment_id = $uuid;
             if ($payment->event_type) {
                 $payment1->event_type = $event->type_id;
             } else {
                 $payment1->event_type = NULL;
             }
             $payment1->save();
             $sale->save();
             $data = array('club' => $club, 'transaction' => $transaction, 'user' => $user, 'contact' => $user_parent);
             //send notification for refund confirmation
             $mail = Mail::send('emails.receipt.refund', $data, function ($message) use($user, $club, $user_parent) {
                 $message->to($user_parent->email)->subject("Refund Confirmation | " . $club->name);
                 foreach ($club->users()->get() as $value) {
                     $message->bcc($value->email, $club->name);
                 }
             });
         }
         //end of transaction result
     }
     //end of amount test
     return Redirect::action('AccountingController@transaction', $payment->transaction);
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:67,代码来源:AccountingController.php


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