|
|
|
@ -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){ |
|
|
|
|