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


PHP customer::find方法代碼示例

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


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

示例1: gymaccess_update

 public function gymaccess_update(Request $request)
 {
     $customer = customer::find($request->id);
     $customer->gymaccess_ind = 1;
     $customer->save();
     $gymaccess = new gymaccess();
     $gymaccess->customer_id = $request->id;
     $gymaccess->activation_date = Carbon::today();
     $rate_id = $request->gymaccess;
     $rate = Rate::where('id', '=', $rate_id)->firstOrFail();
     /*$price = number_format( $rate->price, 2);*/
     if ($rate->period == 'day') {
         $gymaccess->expiration_date = Carbon::today()->addDays($rate->period_count);
     } else {
         if ($rate->period == 'month') {
             $gymaccess->expiration_date = Carbon::today()->addMonths($rate->period_count)->subDay();
         } else {
             if ($rate->period == 'year') {
                 $gymaccess->expiration_date = Carbon::today()->addYears($rate->period_count)->subDay();
             }
         }
     }
     $gymaccess->active_ind = 1;
     $gymaccess->save();
     return redirect('dashboard');
 }
開發者ID:sephestrito,項目名稱:learning-laravel-5,代碼行數:26,代碼來源:CustomersController.php

示例2: get_id

 function get_id($id)
 {
     return customer::find($id);
 }
開發者ID:dieka2501,項目名稱:jip,代碼行數:4,代碼來源:customer.php

示例3: sendCustomerEmail

 public function sendCustomerEmail()
 {
     ini_set('max_execution_time', 3600);
     if (is_null(Session::get('name'))) {
         return View::make('static.index');
     } else {
         $id = Session::get('customer_id');
         $customer = customer::find($id);
         $data = array('name' => $customer->email);
         Mail::send('emails.customer-register-mail', $data, function ($message) use($customer) {
             $message->to($customer->email, $customer->name)->subject('Welcome to ..');
         });
     }
     return View::make('authentication.customer-saved')->with('customer_email', $customer->email);
 }
開發者ID:ashutoshpandey,項目名稱:dicom,代碼行數:15,代碼來源:AuthenticationController.php


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