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


PHP Customer::lists方法代码示例

本文整理汇总了PHP中app\Customer::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::lists方法的具体用法?PHP Customer::lists怎么用?PHP Customer::lists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Customer的用法示例。


在下文中一共展示了Customer::lists方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 public function edit($id)
 {
     $activity = Activity::find($id);
     $cars = Car::lists('name', 'id');
     $customers = Customer::lists('name', 'id');
     $locations = Location::lists('name', 'id');
     $costs = null;
     $items = null;
     $ondayOtherCosts = null;
     if ($activity->type == "On Day") {
         $data = Onday::where('activity_id', '=', $id)->get()->pop();
         $ondayOtherCosts = OndayOtherCost::where('onday_id', $data->id)->get();
     } else {
         if ($activity->type == "Maintenance") {
             $data = Maintenance::where('activity_id', '=', $id)->get()->pop();
             $costs = $activity->maintenance->items;
             $items = Item::lists('name', 'id')->sort();
         } else {
             if ($activity->type == "Nil") {
                 $data = Nil::where('activity_id', '=', $id)->get()->pop();
             }
         }
     }
     return view('activity.edit', ['activity' => $activity, 'data' => $data, 'cars' => $cars, 'customers' => $customers, 'locations' => $locations, 'costs' => $costs, 'items' => $items, 'ondayOtherCosts' => $ondayOtherCosts]);
 }
开发者ID:jubaedprince,项目名称:rkt,代码行数:25,代码来源:ActivityController.php

示例2: processOndayFormView

 public function processOndayFormView()
 {
     $activities = Activity::orderBy('created_at', 'desc')->take(10)->get();
     $customers = Customer::lists('name', 'id');
     $locations = Location::lists('name', 'id')->sort();
     $activity = Session::get('activity');
     $ondayOtherCostItems = OndayOtherCostItem::lists('name', 'id');
     // Session::forget('activity');
     return view('home', ['type' => '1', 'activity' => $activity, 'customers' => $customers, 'locations' => $locations, 'activities' => $activities, 'ondayOtherCostItems' => $ondayOtherCostItems]);
 }
开发者ID:jubaedprince,项目名称:rkt,代码行数:10,代码来源:HomeController.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $order_states = OrderState::lists('id')->toArray();
     $customer_ids = Customer::lists('id')->toArray();
     $employee_ids = Employee::lists('id')->toArray();
     $products = Product::all();
     factory(App\Order::class, 80)->create()->each(function ($order) use($customer_ids, $employee_ids, $order_states, $products) {
         $order->products()->attach($products->shuffle()->first(), ['quantity' => rand(1, 30), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
         $order->ordered_by = shuffle($customer_ids)[0];
         $order->acquired_by = shuffle($employee_ids)[0];
         $order_key = array_rand($order_states);
         $order->state_id = $order_states[$order_key];
     });
 }
开发者ID:vidmahovic,项目名称:ep-store,代码行数:19,代码来源:OrdersTableSeeder.php

示例4: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $customers = Customer::lists('name', 'id')->all();
     return view('persons.create', compact('customers'));
 }
开发者ID:starkbaum,项目名称:sucon,代码行数:10,代码来源:PersonsController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $sales = Sale::orderBy('id', 'desc')->first();
     $customers = Customer::lists('name', 'id');
     return view('sale.index')->with('sale', $sales)->with('customer', $customers);
 }
开发者ID:rambo82,项目名称:tutapos,代码行数:11,代码来源:SaleController.php

示例6: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $estimate = Estimate::findOrFail($id);
     $vehicles = Vehicle::lists('reg_no', 'id')->all();
     $customer_list = Customer::lists('name', 'id')->all();
     $departments = Department::lists('name', 'id');
     $items = Item::lists('name', 'id')->all();
     $estimate_details = DB::table('estimate_details')->where('estimate_id', '=', $id)->get();
     return view('estimates.edit', compact('estimate', 'vehicles', 'estimate_details', 'customer_list', 'departments', 'items'));
 }
开发者ID:suxiid,项目名称:application,代码行数:16,代码来源:EstimatesController.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $transaction = Transaction::find($id);
     $customer = Customer::lists('name', 'id');
     $ship = Ship::lists('name', 'id');
     $pay = Pay::lists('name', 'id');
     return view('transactions.edit', compact('transaction', 'customer', 'ship', 'pay'));
 }
开发者ID:hoangvu2015,项目名称:laravel_totnghiep,代码行数:14,代码来源:TransactionController.php


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