Browse Source

add filter project id

pull/3/head
wahyu 1 year ago
parent
commit
ab1842f5c6
  1. 18
      app/Http/Controllers/PresenceController.php

18
app/Http/Controllers/PresenceController.php

@ -259,13 +259,17 @@ class PresenceController extends Controller
// geom ada di table activity
// $clock_time =
$user = HumanResource::find($params->user_id);
$geom = DB::table("assign_hr_to_activity as ahta")->select("ma.geom", "ma.id")
->join("m_activity as ma", "ma.id", "=", "ahta.activity_id")
->where("ahta.user_id", $params->user_id)
->whereNotNull("ma.geom")
->whereDate("ma.start_date", "<=", $params->time)
->whereDate("ma.end_date", ">=", $params->time)
->get();
$geomQuery = DB::table("assign_hr_to_activity as ahta")->select("ma.geom", "ma.id")
->join("m_activity as ma", "ma.id", "=", "ahta.activity_id")
->where("ahta.user_id", $params->user_id)
->whereNotNull("ma.geom")
->whereDate("ma.start_date", "<=", $params->time)
->whereDate("ma.end_date", ">=", $params->time);
if (isset($params->report_k3['proyek_id'])) {
$geom = $geomQuery->where("ma.proyek_id", $params->report_k3['proyek_id'])->get();
} else {
$geom = $geomQuery->get();
}
$temp = [];
if (count($geom) > 0) {
foreach($geom as $dataGeom){

Loading…
Cancel
Save