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


PHP Payment::find方法代码示例

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


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

示例1: testUpdate

 /**
  * Tests the update function in the PaymentController
  * @param  void
  * @return void
  */
 public function testUpdate()
 {
     $this->withoutMiddleware();
     $this->call('POST', '/payment', $this->paymentData);
     // Update the Payment
     $paymentStored = Payment::orderBy('id', 'desc')->first();
     $this->withoutMiddleware();
     $this->call('PUT', '/payment/1', $this->paymentUpdate);
     $paymentUpdated = Payment::find('1');
     $this->assertEquals($paymentUpdated->patient_id, $this->paymentUpdate['patient_id']);
     $this->assertEquals($paymentUpdated->charge_id, $this->paymentUpdate['charge_id']);
     $this->assertEquals($paymentUpdated->full_amount, $this->paymentUpdate['full_amount']);
     $this->assertEquals($paymentUpdated->amount_paid, $this->paymentUpdate['amount_paid']);
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:19,代码来源:PaymentControllerTest.php

示例2: getPaymentsCount

 /**
  * report generation functions DTR
  */
 public function getPaymentsCount()
 {
     $year = date("Y");
     $current_month = (int) date("m");
     $months = [];
     $j = $current_month;
     for ($i = 0; $i < $j; $i++) {
         $month = $current_month;
         $monthly = Payment::find()->where('MONTH(date) =  :month AND YEAR(date) = :year', [':month' => $month, ':year' => $year])->count();
         array_push($months, $monthly);
         $current_month--;
     }
     $before = array_map('intval', array_reverse($months));
     return json_encode($before);
 }
开发者ID:livingdreams,项目名称:kidcrossing,代码行数:18,代码来源:Payment.php

示例3: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Payment::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'user_id' => $this->user_id, 'amount' => $this->amount, 'status' => $this->status, 'date' => $this->date]);
     $query->andFilterWhere(['like', 'customer_id', $this->customer_id])->andFilterWhere(['like', 'subcription_id', $this->subcription_id])->andFilterWhere(['like', 'ip_address', $this->ip_address])->andFilterWhere(['>=', 'date', $this->start_date])->andFilterWhere(['<=', 'date', $this->end_date]);
     return $dataProvider;
 }
开发者ID:livingdreams,项目名称:kidcrossing,代码行数:23,代码来源:PaymentSearch.php

示例4: actionDashboard

 /**
  * Display user dashboard
  */
 public function actionDashboard()
 {
     //$model = Yii::$app->user->identity;
     $journals = new ActiveDataProvider(['query' => Journal::find()->orderBy(['date' => SORT_DESC])->limit(5), 'pagination' => false]);
     $events = new ActiveDataProvider(['query' => \app\models\Event::find()->orderBy(['date' => SORT_DESC])->limit(5), 'pagination' => false]);
     $photos = \app\models\Photos::find()->orderBy(['id' => SORT_DESC])->limit(5)->all();
     $wishlists = new ActiveDataProvider(['query' => \app\models\Wishlist::find()->where(['status' => 0])->orderBy('id')->limit(5), 'pagination' => false]);
     $DataProvider = new ActiveDataProvider(['query' => User::find()->where('level !=0 AND parent_id=0')->orderBy('id')]);
     $RegisteredMembers = count(User::find()->where('level > :level', [':level' => 3])->orWhere('level > :level', [':level' => 2])->orWhere('level > :level', [':level' => 1])->all());
     $famillies = User::find()->where(['level' => '1'])->count();
     $orders = count(\app\models\Payment::find()->all());
     $payments = Payment::getPaymentsCount();
     $months = Payment::getMonths();
     $epercent = Payment::earningPercentage();
     $earning = Payment::getMonthlyEarning();
     $revenue = Payment::totalRevenue();
     $rpercent = payment::revenuePercentage();
     $mearning = Payment::getPaymentsMonth();
     return $this->render('dashboard', ['dataProvider' => $DataProvider, 'events' => $events, 'journals' => $journals, 'photos' => $photos, 'wishlists' => $wishlists, 'RegisteredMembers' => $RegisteredMembers, 'orders' => $orders, 'payments' => $payments, 'months' => $months, 'epercent' => $epercent, 'earning' => $earning, 'revenue' => $revenue, 'rpercent' => $rpercent, 'mearning' => $mearning, 'famillies' => $famillies]);
 }
开发者ID:livingdreams,项目名称:kidcrossing,代码行数:23,代码来源:AdminController.php

示例5: destroy

 /**
  * Remove the specified payment from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $payment = Payment::find($id);
     $url = session('SOURCE_URL');
     return redirect()->to($url)->with('message', trans('terms.record-successfully-deleted'));
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:12,代码来源:PaymentController.php

示例6: getPaymentList

 public function getPaymentList()
 {
     return Payment::find()->asArray()->all();
 }
开发者ID:Sywooch,项目名称:TailorPlace,代码行数:4,代码来源:StudioForm.php


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