当前位置: 首页>>代码示例>>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;未经允许,请勿转载。