本文整理汇总了PHP中Staff::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::where方法的具体用法?PHP Staff::where怎么用?PHP Staff::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: carian2
public function carian2($carian)
{
if (Request::ajax()) {
if ($carian != '') {
$users = Staff::where('nama', 'like', '%' . $carian . '%')->get();
$count = 1;
$output = '<table class="table table-striped table-bordered responsive">
<thead>
<tr>
<th>Bil</th>
<th>Nama</th>
<th>Sambungan</th>
<th>Speed Dial</th>
<th>Jawatan</th>
</tr>
</thead>
<tbody>';
foreach ($users as $user) {
$kemaskini = URL::route('staff-kemaskini') . '/' . $user->noPekerja;
$output .= '<tr>
<td>' . $count++ . '</td>
<td class="center"><b>' . $user->nama . '</b></td>
<td class="center"><b>' . $user->sambungan . '</b></td>';
$speedDial = '';
if (strlen($user->speedDial) < 4) {
$speedDial = '# ' . $user->speedDial;
} else {
$speedDial = $user->speedDial;
}
$output .= ' <td class="center"><b>' . $speedDial . '</b></td>
<td class="center"><b>' . $user->jawatan . '</b></td>
</tr>';
}
$output .= ' </tbody>
</table>';
if ($users->count() == 0) {
$output = '<table class="table table-striped table-bordered responsive">
<thead>
<tr>
<th>Bil</th>
<th>Nama</th>
<th>No Telefon</th>
<th>Speed Dial</th>
<th>No Faks</th>
<th>Alamat</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="6"><font color="red">Tiada Maklumat</font></td>
</tr>
</tbody>
</table>';
}
return $output;
} else {
return '';
}
}
}
示例2: senaraiSpeedDial2
public function senaraiSpeedDial2()
{
$staff = Staff::where('speedDial', '<>', '0')->where('speedDial', '<>', '')->orderBy('speedDial', 'asc')->get();
$syarikat = Syarikat::where('speedDial', '<>', '')->where('speedDial', '<>', '0')->orderBy('speedDial', 'asc')->get();
$speedDialData[] = '';
foreach ($staff as $staf) {
$speedDialData[$staf->speedDial] = ['nama' => $staf->nama, 'bahagian' => $staf->bahagian, 'speedDial' => $staf->speedDial, 'noPhone' => $staf->noPhone];
}
foreach ($syarikat as $sykt) {
$speedDialData[$sykt->speedDial] = ['nama' => $sykt->nama, 'bahagian' => $sykt->alamat, 'speedDial' => $sykt->speedDial, 'noPhone' => $sykt->noTel];
}
echo '<pre>', var_dump($speedDialData), '</pre>';
foreach ($speedDialData as $data) {
echo $data->nama;
}
return 'done';
return View::make('/admin/senarai/speedDial2')->with('title', 'Senarai Speed Dial')->with('data', $speedDialData);
}
示例3: apiSearch
public function apiSearch($username)
{
$users = Staff::where('nama', 'like', '%' . $username . '%')->get();
return $users = json_encode($users);
}
示例4: show
public function show($id)
{
$this->breadcrumb->append_crumb('Home', base_url());
$this->breadcrumb->append_crumb('Staff Detail', base_url() . '');
$staff = new Staff();
$data['staff'] = $staff->where('staff_id', $id)->get();
$family = new Family();
$data['families'] = $family->where('staff_fam_staff_id', $data['staff']->staff_id)->get();
$work = new Work();
$data['works'] = $work->where('staff_id', $data['staff']->staff_id)->get();
$education = new Education();
$data['educations'] = $education->where('staff_id', $data['staff']->staff_id)->get();
$medical = new Medical();
$data['medicals'] = $medical->where('staff_id', $data['staff']->staff_id)->get();
$asset_detail = new Asset_Detail();
$data['asset_details'] = $asset_detail->where('staff_id', $data['staff']->staff_id)->get();
$data['btn_back'] = anchor('staffs/', 'Back');
$data['btn_edit'] = anchor('staffs/edit/' . $data['staff']->staff_id, 'Edit');
$this->load->view('staffs/show', $data);
}
示例5: Staff
function get_count_dep($cb, $dept)
{
$staff = new Staff();
$query = $staff->where('staff_cabang', 'Bandung')->where('staff_departement', 'Accounting')->count();
return $query;
}