本文整理匯總了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');
}
示例2: get_id
function get_id($id)
{
return customer::find($id);
}
示例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);
}