本文整理汇总了PHP中app\Employee::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::where方法的具体用法?PHP Employee::where怎么用?PHP Employee::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Employee
的用法示例。
在下文中一共展示了Employee::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
$transaction = $request->all();
$empId = $transaction["empId"]['id'];
$siteId = $transaction["siteId"]['id'];
$workDate = $transaction["workDate"];
$day = (double) $transaction["day"];
$ot = (double) $transaction["ot"];
$advance = (double) $transaction["advance"];
//$wage = DB::select(DB::raw("select employee.wage from employee where employee.id=$empId "));
$wage = Employee::where('id', $empId)->first()->wage;
//dd($wage);
$amount = (double) (($day + $ot / 8.0) * $wage);
$transact = SiteEmployeeRel::create(['siteId' => $siteId, 'empId' => $empId, 'workDate' => $workDate, 'day' => $day, 'ot' => $ot, 'advance' => $advance, 'amount' => $amount, 'advance' => $advance]);
//return $transact;
//getting current date
$currentDate = Carbon::now();
//getting current year
$currentYear = $currentDate->year;
//getting current month
$currentMonth = $currentDate->month;
//getting the employee transaction according to current month and year
$transactions = DB::select(DB::raw("select e.name as empName,e.wage, s.name as siteName, t.workDate, t.day ,t.ot,t.advance,t.amount from siteemployeerel as t\n inner join employee as e on t.empId = e.id\n inner join site as s on t.siteId = s.id\n where year(t.workDate) = {$currentYear} and month(t.workDate) = {$currentMonth}\n order by t.created_at;"));
return json_encode(array('transactions' => $transactions));
}
示例2: update
public function update($id)
{
$task = Task::findOrFail($id);
$employees = Employee::where('level_id', '<>', 1)->get();
$dataView = ['task' => $task, 'employees' => $employees];
return view('admin.task.edit', $dataView);
}
示例3: index
/**
* Display a list of employee
* @return \Illuminate\View\View
*/
public function index()
{
$title = 'EMPLOYEE';
if (Input::has('eid')) {
$id = Input::get('eid');
$employees = Employee::where('eid', $id)->paginate(5);
} elseif (Input::has('name')) {
$name = Input::get('name');
$employees = Employee::where('name', 'like', '%' . $name . '%')->paginate(5);
} elseif (Input::has('license')) {
$license = Input::get('license');
$employees = Employee::where('license', 'like', '%' . $license . '%')->paginate(5);
} elseif (Input::has('visa')) {
$visa = Input::get('visa');
$employees = Employee::where('visa', 'like', '%' . $visa . '%')->paginate(5);
} elseif (Input::has('per_country')) {
$country = Input::get('per_country');
$employees = Employee::where('per_country', $country)->paginate(5);
} else {
$employees = Employee::paginate(10);
}
$repository = $this->repository;
//dd($employees);
return view('employee.index', compact('title', 'employees', 'repository'));
}
示例4: update
public function update($id)
{
$customer = Customer::findOrFail($id);
$mrs = Employee::where('level_id', 7)->active()->get();
$dataView = ['customer' => $customer, 'mrs' => $mrs];
return view('admin.customer.edit', $dataView);
}
示例5: index
public function index()
{
$title = 'HOME';
$repository = $this->repository;
$employees = Employee::where('license_expire', '<', Carbon::now()->addDays(30))->orWhere('visa_expire', '<', Carbon::now()->addDays(30))->get();
$vehicles = Vehicles::where('registration_expire', '<', Carbon::now()->addDays(30))->get();
return view('pages.home', compact('title', 'employees', 'vehicles', 'repository'));
}
示例6: listAll
public function listAll()
{
$AMsIds = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
$MRs = Employee::whereIn('manager_id', $AMsIds)->get();
$AMs = Employee::where('manager_id', \Auth::user()->id)->get();
$dataView = ['MRs' => $MRs, 'AMs' => $AMs];
return view('sm.employee.list', $dataView);
}
示例7: search
public function search()
{
$MRs = Employee::where('level_id', 7)->active()->get();
$AMs = Employee::where('level_id', 3)->active()->get();
$SMs = Employee::where('level_id', 2)->active()->get();
$dataView = ['MRs' => $MRs, 'AMs' => $AMs, 'SMs' => $SMs];
return view('admin.search.plans.search', $dataView);
}
示例8: update
public function update($id)
{
$area = Area::findOrFail($id);
$AMs = Employee::where('level_id', 3)->active()->get();
$lines = Line::all();
$dataView = ['area' => $area, 'AMs' => $AMs, 'lines' => $lines];
return view('admin.area.edit', $dataView);
}
示例9: search
public function search()
{
$employeesLines = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get();
$products = Product::where('line_id', $employeesLines)->get();
$MRs = Employee::where('manager_id', \Auth::user()->id)->get();
$dataView = ['products' => $products, 'MRs' => $MRs];
return view('am.search.sales.search', $dataView);
}
示例10: search
public function search()
{
$classes = VisitClass::all();
$specialties = Customer::select('specialty')->distinct()->get();
$MRs = Employee::where('level_id', 7)->get();
$dataView = ['classes' => $classes, 'specialties' => $specialties, 'MRs' => $MRs];
return view('admin.search.coverage.search', $dataView);
}
示例11: update
public function update($id)
{
$territory = Territory::findOrFail($id);
$areas = Area::all();
$MRs = Employee::where('level_id', 7)->active()->get();
$dataView = ['territory' => $territory, 'areas' => $areas, 'MRs' => $MRs];
return view('admin.territory.edit', $dataView);
}
示例12: update
public function update($id)
{
$lines = Line::all();
$levels = Level::all();
$employee = Employee::findOrFail($id);
$salesManagers = Employee::where('level_id', 2)->get();
$areaManagers = Employee::where('level_id', 3)->get();
$dataView = ['lines' => $lines, 'levels' => $levels, 'employee' => $employee, 'salesManagers' => $salesManagers, 'areaManagers' => $areaManagers];
return view('admin.employee.edit', $dataView);
}
示例13: postUpdateadmin
public function postUpdateadmin(Request $request)
{
$emp_id_d = Input::get('emp_id_d');
$post = Input::get();
$i = Employee::where('emp_id', $emp_id_d)->update(array('emp_name' => $post['emp_name'], 'emp_ide_id' => $post['emp_id'], 'emp_status' => $post['emp_status'], 'emp_department' => $post['emp_dept']));
if ($i > 0) {
$request->session()->flash('alert-success', 'Updated Success!');
return redirect('targetmodule/admin');
}
}
示例14: index
public function index()
{
$employees = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get();
$products = Product::whereIn('line_id', $employees)->get();
$employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
$customers = Customer::whereIn('mr_id', $employees)->get();
$employees = Employee::where('manager_id', \Auth::user()->id)->get();
$dataView = ['productsCount' => count($products), 'plansCount' => AMPlan::where('month', \Config::get('app.current_month'))->count(), 'reportsCount' => AMReport::where('month', \Config::get('app.current_month'))->count(), 'customersCount' => count($customers), 'employeesCount' => count($employees)];
return view('am.index', $dataView);
}
示例15: getHome
public function getHome()
{
$varr = Auth::user()->empid;
$evarr = User::where('empid', $varr)->get();
$edetails = Employee::where('emp_ide_id', $varr)->get();
$categories = Event::all();
$employee = Employee::all();
$invoice = Invoice::all();
$invnull = Invoice::where('Status', '=', 'Null')->get();
return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails));
}