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


PHP Client::select方法代码示例

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


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

示例1: performGetClientIdsQuery

 /**
  * Do get client ids query and return them in an array.
  *
  * @param array $config Returned by inspectGetConfigAndAddDefaultValuesToMissingOptions method
  * @return array
  */
 protected static function performGetClientIdsQuery($config)
 {
     $clientIdsQuery = Client::select('id')->where('clients.user_id', $config['userId']);
     // Check if search term is given
     if (isset($config['searchTerm']) && strlen($config['searchTerm']) > 0) {
         $clientIdsQuery = $clientIdsQuery->where('clients.name', 'like', $config['searchTerm'] . '%')->get();
     } else {
         $clientIdsQuery = $clientIdsQuery->get();
     }
     // Build an array that contains only clint ids
     $clientIds = [];
     foreach ($clientIdsQuery as $result) {
         $clientIds[] = $result->id;
     }
     return $clientIds;
 }
开发者ID:bitller,项目名称:nova,代码行数:22,代码来源:ProtectedHelpers.php

示例2: function

<?php

use App\User;
use App\Client;
use App\Time;
use App\Project;
use Faker\Generator as FakerGenerator;
$factory->define(User::class, function (FakerGenerator $faker) {
    return ['name' => $faker->name, 'email' => $faker->safeEmail, 'password' => bcrypt(str_random(10)), 'remember_token' => str_random(10)];
});
$factory->define(Client::class, function (FakerGenerator $faker) {
    return ['active' => $faker->boolean(50), 'name' => $faker->company(), 'contactName' => $faker->name(), 'contactEmail' => $faker->safeEmail(), 'address1' => $faker->streetAddress(), 'address2' => $faker->secondaryAddress(), 'city' => $faker->city(), 'locality' => $faker->stateAbbr(), 'postalCode' => $faker->postcode(), 'phone' => $faker->phoneNumber()];
});
$factory->define(Project::class, function (FakerGenerator $faker) {
    $randomClient = Client::select('id')->orderByRaw('RANDOM()')->limit(1)->first();
    return ['client_id' => $randomClient->id, 'name' => sprintf('%s %s %d', 'Project', $faker->colorName(), $faker->randomDigit()), 'active' => $faker->boolean(), 'billable' => $faker->boolean(), 'taxDeducted' => $faker->boolean()];
});
$factory->define(Time::class, function (FakerGenerator $faker) {
    $randomHours = $faker->numberBetween(1, 8);
    $randomMinutes = $faker->numberBetween(0, 180);
    $randomProject = Project::select('id')->orderByRaw('RANDOM()')->limit(1)->first();
    $randomUser = User::select('id')->orderByRaw('RANDOM()')->limit(1)->first();
    $start = $faker->dateTimeBetween('-10 years', '-1 day');
    return ['user_id' => $randomUser->id, 'start' => $start, 'minutes' => $randomMinutes, 'estimatedDuration' => $faker->numberBetween(1, 480), 'summary' => $faker->paragraph(), 'project_id' => $randomProject->id];
});
开发者ID:lovett,项目名称:toils,代码行数:25,代码来源:ModelFactory.php

示例3: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $user = User::findOrFail($id);
     $clients = Client::select('id', \DB::raw('CONCAT(firm_name, " ", first_name, " ", last_name) as full_name'))->lists('full_name', 'id');
     return view('admin.user.edit', compact('user', 'clients'));
 }
开发者ID:thibaultvanc,项目名称:organit,代码行数:13,代码来源:UserController.php

示例4: getClients

 /**
  * Paginate clients.
  *
  * @return mixed
  */
 public function getClients()
 {
     return Client::select(DB::raw('clients.*, COUNT(bills.id) as number_of_orders'))->leftJoin('bills', 'bills.client_id', '=', 'clients.id')->where('clients.user_id', Auth::user()->id)->orderBy('clients.created_at', 'desc')->groupBy('clients.id')->paginate(Settings::displayedClients());
 }
开发者ID:bitller,项目名称:nova,代码行数:9,代码来源:ClientsController.php

示例5: get

 /**
  * Get from query
  */
 public function get($page = null)
 {
     return $this->query(Client::select(), $page);
 }
开发者ID:jiannius,项目名称:lar5-invie,代码行数:7,代码来源:ClientRepo.php


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