我的表:員工身份證 | 姓名隨著時(shí)間的推移身份證 | total_day | 日期加班_詳情身份證 | 加班時(shí)間_id | 員工_id | 支付我的控制器:public function details($id,$day) { $day = $d; // d -> day on buttons $count = DB::table('overtime') ->select ('employee.name as employeename', 'overtime_details.payment as paymentemployee') ->join ('overtime_details', 'overtime_details.overtime_id', '=', 'overtime.id') ->join ('employee', 'employee.id', '=', 'overtime_details.employee_id') ->where ('day', $d) ->get(); // dd($count); return view('countovertime.overtimedetails')->withCount($count); }當(dāng)我使用dd, $count功能檢查獲得的數(shù)據(jù)時(shí),它按我的預(yù)期正常工作,但是當(dāng)dd關(guān)閉數(shù)據(jù)檢查功能并返回查看頁面選擇第一天按鈕時(shí),頁面顯示為第一天員工加班,但是當(dāng)?shù)诙禳c(diǎn)擊按鈕時(shí),頁面仍然顯示第一天的數(shù)據(jù)。這是我的頁面視圖:[Button day 1] [Button day 2] ->這個(gè)以加班“天”表為準(zhǔn)我的按鈕控制器:return DataTables::eloquent($model) ->addColumn('day', function(countovertime $st){$links = ''; for ($d = 1; $h <= $st->day; $d++) { $links .= ' <a href="overtimedetails/'. $st->id .'/'.$d.'" class="btn btn-danger btn-sm">Day-'. $d .'</a>'; } return $links;
- 2 回答
- 0 關(guān)注
- 221 瀏覽
添加回答
舉報(bào)
0/150
提交
取消