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


PHP Payment::where方法代码示例

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


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

示例1: index

 public function index()
 {
     $payments = Payment::where('account_code', 'like', '2%')->paginate(Config::get('common.pagination'));
     $accounts = ChartOfAccount::where('account_type', 1)->where('code', 'like', '2%')->lists('name', 'code');
     $status = Config::get('common.status');
     return view('makePayment.index', compact('payments', 'status', 'accounts'));
 }
开发者ID:saj696,项目名称:pipe,代码行数:7,代码来源:MakePaymentsController.php

示例2: getResult

 public function getResult(Request $request)
 {
     $out_sum = $request->get('OutSum');
     $inv_id = $request->get('InvId');
     $user = Payment::select('user_id')->where('uid', '=', $inv_id)->first();
     $checksum = $request->get('SignatureValue');
     $password2 = config('roboconfig.password2');
     if (strtolower($checksum) == strtolower(md5($out_sum . ":" . $inv_id . ":" . $password2))) {
         if (Payment::where('uid', '=', $inv_id) && Payment::where('balance', '=', $out_sum)) {
             try {
                 DB::beginTransaction();
                 $payment = Payment::where('uid', '=', $inv_id)->first();
                 if ($payment->status == 0) {
                     $payment->status = 1;
                     $payment->update();
                     $addBalanceToUser = User::find($user->user_id);
                     $addBalanceToUser->balance += $out_sum;
                     $addBalanceToUser->update();
                 }
                 DB::commit();
             } catch (\PDOException $e) {
                 \Session::flash('message', "{$e->getMessage}()");
                 DB::connection()->getPdo()->rollBack();
             }
         }
     }
     return redirect()->action('ProfileController@index');
 }
开发者ID:Gurzhii,项目名称:laravel-robokassa,代码行数:28,代码来源:IpnRobokassaController.php

示例3: ingnoreId

 /**
  * @return \Illuminate\Routing\Route|null|string
  */
 public function ingnoreId()
 {
     $id = $this->route('payment');
     $patient_id = $this->input('patient_id');
     $charge_id = $this->input('charge_id');
     $full_amount = $this->input('full_amount');
     return Payment::where(compact('id', 'test_id'))->exists() ? $id : '';
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:11,代码来源:PaymentRequest.php

示例4: getResult

 /**
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|void
  */
 public function getResult(Request $request)
 {
     if ($_SERVER['REMOTE_ADDR'] != '37.59.221.230') {
         return;
     }
     //dd(\Request::all());
     $m_key = 'halyava';
     $m_shop = $request->get('m_shop');
     $m_orderid = $request->get('m_orderid');
     $m_amount = $request->get('m_amount');
     $m_curr = $request->get('m_curr');
     $m_desc = $request->get('m_desc');
     $checksum = $request->get('m_sign');
     $user = Payment::select('user_id')->where('uid', '=', $m_orderid)->first();
     if (isset($_POST['m_operation_id']) && isset($checksum)) {
         $arHash = array($m_shop, $m_orderid, $m_amount, $m_curr, $m_desc, $m_key);
         $sign_hash = strtoupper(hash('sha256', implode(':', $arHash)));
         if ($checksum == $sign_hash && $_POST['m_status'] == 'success') {
             if (Payment::where('uid', '=', $m_orderid) && Payment::where('balance', '=', $m_amount)) {
                 try {
                     DB::beginTransaction();
                     $payment = Payment::where('uid', '=', $m_orderid)->first();
                     if ($payment->status == 0) {
                         $payment->status = 1;
                         $payment->update();
                         $addBalanceToUser = User::find($user->user_id);
                         $addBalanceToUser->balance += $m_amount;
                         $addBalanceToUser->update();
                     }
                     DB::commit();
                 } catch (\PDOException $e) {
                     \Session::flash('message', "{$e->getMessage}()");
                     DB::connection()->getPdo()->rollBack();
                 }
             }
         }
     }
     return redirect()->action('ProfileController@index');
 }
开发者ID:za-laravel,项目名称:laravel-payeer,代码行数:43,代码来源:IpnPayeerController.php

示例5: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create($event_id)
 {
     $event = Event::find($event_id);
     if ($event->cancelled || empty($event)) {
         Session::flash('message', 'Evento cancelado');
         Session::flash('alert-class', 'alert-warning');
         return redirect('promoter/event/record');
     }
     $amountAccumulated = $event->amountAccumulated();
     $amountComission = $amountAccumulated * $event->percentage_comission / 100;
     $totalToPay = $amountAccumulated - $amountComission;
     $paid = Payment::where("event_id", $event_id)->sum('paid');
     $debt = 0;
     if ($totalToPay > $paid) {
         $debt = $totalToPay - $paid;
     }
     if ($debt <= 0) {
         Session::flash('message', 'No se puede transferir, tiene deuda igual a cero');
         Session::flash('alert-class', 'alert-warning');
         return redirect('promoter/event/record');
     }
     $objs = array("event" => $event, "amountAccumulated" => $amountAccumulated, "benefit" => $amountComission, "totalToPay" => $totalToPay, "paid" => $paid, "debt" => $debt);
     return view('internal.promoter.payment.create', $objs);
 }
开发者ID:TAMQuiroz,项目名称:starkTicket,代码行数:29,代码来源:PaymentController.php


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