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


PHP Customer::with方法代码示例

本文整理汇总了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]);
 }
开发者ID:hungnt167,项目名称:CDShop,代码行数:17,代码来源:AuthController.php

示例2: getCustomerDetail

 public function getCustomerDetail($id, Customer $customer)
 {
     $customerdetail = $customer->with('profile', 'payment')->whereId((int) $id)->first();
     return view('customers.detail')->with(compact('customerdetail'));
 }
开发者ID:BarkaBoss,项目名称:TheHex,代码行数:5,代码来源:CustomerController.php

示例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);
     //
 }
开发者ID:keylukman,项目名称:latihan_aja_ya,代码行数:12,代码来源:CustomerController.php

示例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);
 }
开发者ID:abhilash698,项目名称:projectc,代码行数:16,代码来源:SuperAdminController.php

示例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!'];
 }
开发者ID:BarkaBoss,项目名称:TheHex,代码行数:8,代码来源:HomeController.php

示例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;
 }
开发者ID:smadeira,项目名称:yellowBucketLaravel,代码行数:13,代码来源:CustomerController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $customers = Customer::with('account')->get();
     return view('customer.index', compact('customers'));
 }
开发者ID:renciebautista,项目名称:perfectstore,代码行数:10,代码来源:CustomerController.php


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