本文整理汇总了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);
}