當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Payment::with方法代碼示例

本文整理匯總了PHP中Payment::with方法的典型用法代碼示例。如果您正苦於以下問題:PHP Payment::with方法的具體用法?PHP Payment::with怎麽用?PHP Payment::with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Payment的用法示例。


在下文中一共展示了Payment::with方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: show

 public function show($id)
 {
     // get payment
     $payment = Payment::with(array('user', 'donations'))->find($id);
     if ($payment == null) {
         return App::abort('404');
     }
     // init
     $data = array('menu' => $this->_menu, 'title' => 'Pembayaran - ' . $payment->id, 'description' => '', 'breadcrumb' => array('Donasi & Pembayaran' => route('admin.donation'), $payment->id => route('admin.payment.show', $payment->id)));
     foreach ($payment->donations as $i => $donation) {
         $donation->setAppends(array('type'));
     }
     $data['payment'] = $payment;
     return View::make('admin.pages.payment.show')->with($data);
 }
開發者ID:whiterun,項目名稱:bagikasih-v2,代碼行數:15,代碼來源:AdminPaymentController.php

示例2: getPaymentsReport

 public function getPaymentsReport()
 {
     // Get the payments in the last 24 hours.
     $payments = \Payment::with('payment_type')->sinceHoursAgo(24);
     // Check if the payments are for a particular location
     if (isset($this->data['branch_id'])) {
         $payments->where('branch_id', $this->data['branch_id']);
     }
     // Construct
     foreach ($payments->get() as $payment) {
         $this->response->addMessage($payment->toArray());
     }
     if ($payments->count() > 0) {
         $this->response->setSuccess(1);
     } else {
         $this->response->addMessage('No data');
     }
     return $this->output();
 }
開發者ID:salmander,項目名稱:flypay_restaurant_api,代碼行數:19,代碼來源:FlyPay.php

示例3: index

 public function index()
 {
     // init
     $data = array('menu' => $this->_menu, 'title' => 'Dashboard', 'description' => '', 'breadcrumb' => array('Dashboard' => '/'));
     // New payment that need confirmation
     $data['payments'] = Payment::with(array('user', 'donations'))->where('status', '=', 0)->get();
     // New social target that need confirmation
     $data['social_targets'] = SocialTarget::with(array('city', 'category', 'user'))->where('status', '=', 0)->get();
     // New action action that need confirmation
     $data['social_actions'] = SocialAction::with(array('city', 'category', 'user'))->where('status', '=', 0)->get();
     // New event that need confirmation
     $data['events'] = Events::with(array('city', 'category', 'user'))->where('status', '=', 0)->get();
     // New report that need confirmation
     $reports = Report::with(array('user'))->where('have_responded', '=', 0)->get();
     foreach ($reports as $report) {
         $report->setAppends(array('type'));
     }
     $data['reports'] = $reports;
     // return $data;
     return View::make('admin.pages.dashboard')->with($data);
 }
開發者ID:whiterun,項目名稱:bagikasih-v2,代碼行數:21,代碼來源:AdminDashboardController.php

示例4: show

 public function show($id)
 {
     // get donation
     $donation = Donation::with(array('user'))->find($id);
     if ($donation == null) {
         return App::abort('404');
     }
     // init
     $data = array('menu' => $this->_menu, 'title' => 'Donasi & Pembayaran - ' . $donation->id, 'description' => '', 'breadcrumb' => array('Donasi & Pembayaran' => route('admin.donation'), $donation->id => route('admin.donation.show', $donation->id)));
     // Get Donation
     $donation->setAppends(array('type'));
     $data['donation'] = $donation;
     // Get Payment that related with this
     if ($donation->payment_id != NULL) {
         $payment = Payment::with(array('user', 'donations'))->find($donation->payment_id);
         foreach ($payment->donations as $i => $donation) {
             $donation->setAppends(array('type'));
         }
         $data['payment'] = $payment;
     }
     return View::make('admin.pages.donation.show')->with($data);
 }
開發者ID:whiterun,項目名稱:bagikasih-v2,代碼行數:22,代碼來源:AdminDonationController.php

示例5: reject

 public static function reject($id)
 {
     $payment = Payment::with(array('user', 'donations'))->find($id);
     if ($payment == null) {
         return array('success' => false, 'errors' => array('Pembayaran tidak ditemukan.'));
     }
     if ($payment->status != 0) {
         return array('success' => false, 'errors' => array('Pembayaran sudah pernah direspon oleh admin sebelumnya.'));
     }
     // delete
     // $payment->delete();
     $payment->status = 2;
     $payment->save();
     // update donation
     Donation::where('payment_id', '=', $payment->id)->update(array('status' => 0, 'payment_id' => NULL));
     // set type for each donation
     foreach ($payment->donations as $donation) {
         $donation->setAppends(array('type'));
     }
     // send email to donor
     Newsletter::addPaymentNewsletter($payment);
     return array('success' => true, 'data' => $payment);
 }
開發者ID:whiterun,項目名稱:bagikasih-v2,代碼行數:23,代碼來源:Payment.php

示例6: showCoach

 public function showCoach($id)
 {
     $user = Auth::user();
     $team = Team::find($id);
     $club = $team->club;
     $coaches = $team->coaches()->get();
     $members = Member::where('team_id', '=', $team->id)->with('team')->get();
     $title = 'League Together - ' . $team->club->name . ' Teams';
     $pay = Payment::with(array('items' => function ($query) {
     }))->get();
     $sales = Item::where('team_id', $team->id)->get();
     $receivable = SchedulePayment::with('member')->whereHas('member', function ($query) use($team) {
         $query->where('team_id', '=', $team->id);
     })->get();
     $announcements = Announcement::where('team_id', $team->id)->get();
     return View::make('app.account.team.show')->with('page_title', $title)->with('team', $team)->with('club', $club)->with('coaches', $coaches)->with('members', $members)->with('sales', $sales)->with('receivable', $receivable)->with('announcements', $announcements)->withUser($user);
 }
開發者ID:illuminate3,項目名稱:league-production,代碼行數:17,代碼來源:TeamController.php


注:本文中的Payment::with方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。