Browse Source

Merge pull request 'fix clock_in time in map monitoring' (#163) from dev-ardhi into staging

Reviewed-on: ordo/adw-backend#163
pull/3/head
ibnu 1 year ago
parent
commit
3df80dfb31
  1. 15
      app/Http/Controllers/MapMonitoringController.php

15
app/Http/Controllers/MapMonitoringController.php

@ -37,15 +37,11 @@ class MapMonitoringController extends Controller
'tcio.clock_in_lng',
'tcio.clock_in_loc',
'tcio.clock_out_loc',
'tcio.date_presence',
'mw.lat',
'mw.lon',
'mw.wptime'
'tcio.date_presence'
)
->join('m_users as mu', 'mu.id', '=', 'tcio.user_id')
->join('m_waypoint as mw', 'mu.id', '=', 'mw.user_id')
->where('mu.id', $key->user_id)
->orderBy('mw.wptime', 'DESC')
->orderBy('tcio.clock_in', 'DESC')
->first();
$project = DB::table('assign_hr_to_proyek as ahtp')
->select('ahtp.proyek_id as id', 'mp.nama as project_name')
@ -55,11 +51,12 @@ class MapMonitoringController extends Controller
->get();
if ($presensi && isset($presensi->user_id)) {
$image = DB::table('m_image')->select('image')->where('category', 'presensi')->where('ref_id', $presensi->clock_in_out_id)->first();
$waypoint = DB::table('m_waypoint')->select('lat', 'lon', 'wptime')->where('user_id', $presensi->user_id)->orderBy('wptime', 'DESC')->first();
$tmp[] = array(
'user_id' => $presensi->user_id,
'wp_lat' => $presensi->lat,
'wp_lon' => $presensi->lon,
'wp_time' => $presensi->wptime,
'wp_lat' => isset($waypoint) ? $waypoint->lat : '-',
'wp_lon' => isset($waypoint) ? $waypoint->lon : '-',
'wp_time' => isset($waypoint) ? $waypoint->wptime : '-',
'clock_in' => $presensi->clock_in,
'clock_out' => $presensi->clock_out,
'clock_in_lat' => $presensi->clock_in_lat,

Loading…
Cancel
Save