/** * Get all of the tasks for a given user. * * @param User $user * @return Collection */ public function countBranchMandtlByDate(User $user, $date) { return Manskedday::with('countMandtls')->select('manskedday.*')->leftJoin('manskedhdr', function ($join) { $join->on('manskedday.manskedid', '=', 'manskedhdr.id'); })->where('manskedhdr.branchid', '=', $user->branchid)->where('manskedday.date', '=', $date); }
public function makeEditView(Request $request, $param1) { $manday = Manday::with('manskedhdr')->find($param1); //return $manday; if (count($manday) > 0) { // check if the $id if (strtotime($manday->date) < strtotime('now')) { return redirect(URL::previous())->with(['alert-warning' => 'Editing is disabled! Date already passed...']); } $depts = $this->empGrpByDeptWithManday($request, $param1); } else { return redirect('task/mansked'); } //return date('H:i', strtotime('08:00')); //return view('task.manday.edit')->with('depts', $depts)->with('manday', $manday); return view('task.manday.edit2')->with('depts', $depts)->with('manday', $manday)->with('hours', $this->hourlyDuty($depts)); }