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


PHP Customer::whereId方法代码示例

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


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

示例1: update

 public function update(Request $request, $id)
 {
     $customer = Customer::whereId($id)->first();
     $customer->fill($request->all());
     $customer->push();
     return redirect('/customer/' . $id . '/show')->with('status', Alert::get('success', 'Informationen är uppdaterad.'));
 }
开发者ID:znittzel,项目名称:datianew,代码行数:7,代码来源:CustomerController.php

示例2: update

 public function update(Request $request, $id)
 {
     $customer = Customer::whereId($id)->firstOrFail();
     $customer->customer = $request->get('customer');
     $customer->street = $request->get('street');
     $customer->city = $request->get('city');
     $customer->state = $request->get('state');
     $customer->zip = $request->get('zip');
     $customer->save();
     Toastr::success('Customer updated.');
     return redirect(action('CustomersController@index', $customer->{$customer}));
 }
开发者ID:petrovitch,项目名称:chess,代码行数:12,代码来源:CustomersController.php

示例3: show

 public function show($id)
 {
     $order = Order::whereId($id)->firstOrFail();
     $coffee1 = DB::table('coffees')->where('id', 2)->first();
     $coffee2 = DB::table('coffees')->where('id', 3)->first();
     $coffee3 = DB::table('coffees')->where('id', 4)->first();
     $coffee4 = DB::table('coffees')->where('id', 5)->first();
     $coffee5 = DB::table('coffees')->where('id', 6)->first();
     $pastry1 = DB::table('pastries')->where('id', 7)->first();
     $pastry2 = DB::table('pastries')->where('id', 10)->first();
     $pastry3 = DB::table('pastries')->where('id', 11)->first();
     $pastry4 = DB::table('pastries')->where('id', 12)->first();
     $pastry5 = DB::table('pastries')->where('id', 15)->first();
     $total = 0;
     for ($i = 1; $i < 6; $i++) {
         $total = ${'coffee' . $i}->price * $order->{'coffee' . $i} + ${'pastry' . $i}->price * $order->{'pastry' . $i} + $total;
     }
     $user = \Auth::user();
     $customer = Customer::whereId($order->customerid)->firstOrFail();
     return view('order.show', compact('order', 'coffee1', 'coffee2', 'coffee3', 'coffee4', 'coffee5', 'pastry1', 'pastry2', 'pastry3', 'pastry4', 'pastry5', 'total', 'user', 'customer'));
 }
开发者ID:jakzaizzat,项目名称:KopiBean,代码行数:21,代码来源:.OrdersController.php

示例4: postCustomerEdit

 public function postCustomerEdit(NewCustomerRequest $request, Customer $customer, CustomerProfile $profile, Payment $payment)
 {
     $id = $request->input('customer_id');
     $this->customer = $customer->whereId((int) $id)->update(['firstname' => Str::title($request->input('firstname')), 'lastname' => Str::title($request->input('lastname')), 'email' => Str::lower($request->input('email')), 'phone' => $request->input('phone')]);
     $dob = explode('/', $request->input('dob'));
     $dob_piece = [$dob[2], $dob[1], $dob[0]];
     $this->profile = $profile->where('customer_id', (int) $id)->update(['dob' => implode('-', $dob_piece), 'gender_id' => $request->input('gender'), 'state_id' => $request->input('state_of_origin'), 'hostel_address' => $request->input('hostel_address'), 'guardian_name' => Str::words($request->input('guardian_name')), 'guardian_phone' => $request->input('guardian_phone'), 'guardian_address' => $request->input('guardian_address')]);
     $this->payment = $payment->where('customer_id', (int) $id)->update(['account_balance' => $request->input('account_balance')]);
     if (!$this->customer && !$this->profile) {
         flash()->error('An error occurred, try updating the Customer again!');
     } else {
         flash()->success('Customer Updated Successfully!');
     }
     return redirect()->route('customer.list');
 }
开发者ID:BarkaBoss,项目名称:TheHex,代码行数:15,代码来源:CustomerController.php

示例5: getById

 public function getById($id)
 {
     $customer = Customer::whereId($id)->with(['source', 'producers', 'samples' => function ($query) {
         $query->orderBy('created_at', 'desc');
     }, 'samples.assay_result'])->first();
     return $customer;
 }
开发者ID:manogi,项目名称:gfw-qm,代码行数:7,代码来源:EloquentCustomerRepository.php

示例6: remainPay

 public function remainPay($id, SaleOrder $saleOrders, Request $request)
 {
     $customer = Customer::whereId($id)->first();
     $saleOrder = SaleOrder::where('sales_orders.customer_id', $id)->where("sales_orders.balance", ">", 0)->get();
     return view('saleOrders/remainPay', compact('saleOrder', 'customer'));
 }
开发者ID:sethathay,项目名称:PPBakery,代码行数:6,代码来源:SaleOrdersController.php

示例7: processPasteBuyerId

 public function processPasteBuyerId(Request $request)
 {
     $data = $request->get('buyerIdList');
     $fileContents = trim($data);
     if (empty($fileContents)) {
         return $this->json->error('Paste Box Must Not Be Empty ...');
     }
     $fileLines = explode("\r\n", $fileContents);
     $fileLines = explode("\r", $fileContents);
     $maxLineCount = count($fileLines);
     $user = Auth::user();
     for ($x = 0; $x < $maxLineCount; $x++) {
         //dd( $fileLines[ $x ] );
         $urlArray = parse_url($fileLines[$x]);
         if (!is_array($urlArray) or !isset($urlArray['query'])) {
             continue;
         }
         parse_str($urlArray['query'], $query);
         $buyerId = $query['buyerID'];
         $orderId = $query['orderID'];
         /*$transaction = Transaction::where( 'amazon_order_id', '=', $orderId )
           ->with( ['customer.user' => function( $query ) use( $user ) {
               $query->where( 'id', '=', $user->id );
           }])->first();*/
         $transaction = Transaction::where('amazon_order_id', '=', $orderId)->first();
         if (!$transaction) {
             continue;
         }
         $customer = Customer::whereId($transaction->customer_id)->first();
         if (!$customer) {
             continue;
         }
         if ($customer->user_id != $user->id) {
             continue;
         }
         $customer->buyer_id = $buyerId;
         $customer->save();
     }
     return $this->json->success('SUCCESS!!! Import data done ....');
 }
开发者ID:aljogabot,项目名称:AmazonStats,代码行数:40,代码来源:ImportDataController.php

示例8: Collection

 });
 $individualIds = array_diff($idArray, $range);
 $customers = new Collection();
 //fetch users
 if (count($range)) {
     foreach ($range as $fromTo) {
         $rangeFromTo = array_map(function ($item) {
             return trim($item);
         }, preg_split('/-/', $fromTo));
         $customers = $customers->merge(Customer::where('id', ">=", $rangeFromTo[0])->where('id', "<=", $rangeFromTo[1])->get());
     }
 }
 if (count($individualIds)) {
     foreach ($individualIds as $id) {
         $id = trim($id);
         $customers = $customers->merge(Customer::whereId($id)->get());
     }
 }
 $variableMapping = ['/\\%CHI_NAME\\%/' => "chinese_name", '/\\%ENG_NAME\\%/' => "english_name", '/\\%TODAY\\%/' => "today", '/\\%LOGIN\\%/' => "loginname", '/\\%PASSWORD\\%/' => "password"];
 $template = \App\Template::firstOrFail()->template;
 $letters = [];
 foreach ($customers as $user) {
     $letter = $template;
     foreach ($variableMapping as $pattern => $variable) {
         if ($pattern == '/\\%TODAY\\%/') {
             $today = \Carbon\Carbon::create()->toDateString();
             $letter = preg_replace($pattern, $today, $letter);
         } else {
             $letter = preg_replace($pattern, $user->{$variable}, $letter);
         }
     }
开发者ID:xavierauana,项目名称:sbctemp,代码行数:31,代码来源:routes.php

示例9: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Customer $cus)
 {
     //
     $data = $request->all();
     unset($data['_token']);
     unset($data['_method']);
     $data['created_by'] = \Auth::user()->id;
     $data['updated_by'] = \Auth::user()->id;
     $data['is_active'] = 1;
     $cus->whereId(Input::get('id'))->update($data);
     return Redirect::route('customers.index');
 }
开发者ID:sethathay,项目名称:PPBakery,代码行数:19,代码来源:CustomersController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $customer = Customer::whereId($id)->firstOrFail();
     $customer->delete();
     return redirect('/customers')->with('status', 'The selected customer has been deleted');
 }
开发者ID:jakzaizzat,项目名称:KopiBean,代码行数:12,代码来源:CustomersController.php


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