本文整理汇总了PHP中app\models\Client::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::select方法的具体用法?PHP Client::select怎么用?PHP Client::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Client
的用法示例。
在下文中一共展示了Client::select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClients
public function getClients($id)
{
$vendedor = Vendedor::find($id);
$client = Client::select('name', 'telephone')->with('vendedor')->where('vendedor_id', '=', $id)->get();
//dd($clients->toArray());
return view("vendedores.clients")->with(array('vendedor' => $vendedor, 'client' => $client));
return redirect()->back();
}
示例2: clientData
public function clientData($id)
{
$clients = Client::select(['id', 'name', 'company_name', 'primary_number', 'email'])->where('fk_user_id', $id);
return Datatables::of($clients)->addColumn('clientlink', function ($clients) {
return '<a href="' . route('clients.show', $clients->id) . '">' . $clients->name . '</a>';
})->editColumn('created_at', function ($clients) {
return $clients->created_at ? with(new Carbon($clients->created_at))->format('d/m/Y') : '';
})->editColumn('deadline', function ($clients) {
return $clients->created_at ? with(new Carbon($clients->created_at))->format('d/m/Y') : '';
})->make(true);
}
示例3: anyData
public function anyData()
{
$clients = Client::select(['id', 'name', 'company_name', 'email', 'primary_number']);
return Datatables::of($clients)->addColumn('namelink', function ($clients) {
return '<a href="clients/' . $clients->id . '" ">' . $clients->name . '</a>';
})->add_column('edit', '
<a href="{{ route(\'clients.edit\', $id) }}" class="btn btn-success" >Edit</a>')->add_column('delete', '
<form action="{{ route(\'clients.destroy\', $id) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="submit" name="submit" value="Delete" class="btn btn-danger" onClick="return confirm(\'Are you sure?\')"">
{{csrf_field()}}
</form>')->make(true);
}
示例4: postDetail
public function postDetail()
{
$return['success'] = 0;
if (Input::has('id')) {
$client = Client::select('name', 'logo', 'created_at as cdate')->find(Input::get('id'));
if ($client !== null) {
$return['success'] = 1;
$data['name'] = $client->name;
$data['logo'] = $client->logo;
$data['created_at'] = $client->cdate;
$return['data'] = $data;
}
}
echo json_encode($return);
}