本文整理汇总了PHP中app\Customer::with方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::with方法的具体用法?PHP Customer::with怎么用?PHP Customer::with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Customer
的用法示例。
在下文中一共展示了Customer::with方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUpdatePaymentAddressCustomer
public function getUpdatePaymentAddressCustomer()
{
View::share(['navigator' => \NavigatorHelper::getNavigatorBarFE(), 'sideBar' => \NavigatorHelper::getSideBarFE()]);
if (!Session::has('user')) {
return redirect_errors('You login yet!');
}
$user = Session::get('user');
if ($user['role_id'] != Role::CUS_ROLE_ID) {
return redirect_errors('You are not Customer!');
}
$customer = new Customer();
$cusInfo = $customer->with('user')->where('user_id', $user['id'])->first()->toArray();
$current_City = Address::find($cusInfo['city_id'])->id;
$cities = Address::where('parent_id', 0)->get()->toArray();
$state = Address::find($cusInfo['state_id'])->toArray();
return view('change_payment_address.index')->with(['info' => $cusInfo, 'currentCity' => $current_City, 'cities' => $cities, 'state' => $state]);
}
示例2: getCustomerDetail
public function getCustomerDetail($id, Customer $customer)
{
$customerdetail = $customer->with('profile', 'payment')->whereId((int) $id)->first();
return view('customers.detail')->with(compact('customerdetail'));
}
示例3: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($idcus)
{
$customer = Customer::with('pic', 'kas', 'ms', 'tr')->find($idcus);
return View('customer.show')->with('customer', $customer);
//
}
示例4: getStoreCustomers
public function getStoreCustomers($id, $period)
{
if ($period == 'today') {
$customers = Customer::with('Store')->where('store_id', $id)->whereRaw('date(customers.created_at) >= date("' . Carbon::today() . '")')->paginate(10);
} elseif ($period == 'week') {
$lastWeek = Carbon::now()->subWeek();
$customers = Customer::with('Store')->where('store_id', $id)->whereRaw('date(customers.created_at) >= date("' . $lastWeek . '")')->paginate(10);
} elseif ($period == 'month') {
$lastMonth = Carbon::now()->subMonth();
$customers = Customer::with('Store')->where('store_id', $id)->whereRaw('date(customers.created_at) >= date("' . $lastMonth . '")')->paginate(10);
} else {
$customers = Customer::with('Store')->where('store_id', $id)->paginate(10);
}
$output = array('customers' => $customers, 'store_id' => $id);
return view('admin.storeCustomers', $output);
}
示例5: getCustomerForCashierDesk
public function getCustomerForCashierDesk(Request $request, Customer $customer)
{
if ($request->ajax()) {
$thc_customer = $customer->with('profile', 'payment')->where('thc', $request->input('thc'))->first();
return $thc_customer;
}
return ['error' => 'An error occurred!'];
}
示例6: getRentalHistory
/**
* Get the kiosks that have a movie with total qty by type (DVD or BluRay)
*
* @param $id
* @return array
*/
public function getRentalHistory($id)
{
$rentals = Customer::with(['rentals' => function ($query) {
return $query->with('movieTitle');
}])->find($id)->toArray();
return $rentals;
}
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$customers = Customer::with('account')->get();
return view('customer.index', compact('customers'));
}