This query it's worked for now.
$konfHistory = DB::table('t_history_cuti as hc')
->leftjoin('m_detail_organisasi as do', 'do.nik_staff', '=', 'hc.nik')
->join('m_karyawan as kary', 'kary.nik', '=', 'hc.nik')
->join('m_rumah_sakit as rs', 'rs.kd_rs', '=', 'kary.kd_rs')
->join('m_jabatan as jab', 'jab.kd_jabatan', '=', 'kary.kd_jabatan')
->join('m_unit as unit', 'unit.kd_unit', '=', 'kary.kd_unit')
->where('hc.kd_rs', $kdRS)
->where('do.koreksi', false)
->where('do.nik_penanggung_jawab', $nik)
->select('hc.*', 'kary.nik', 'kary.nm_karyawan', 'jab.nm_jabatan', 'rs.nm_rs', 'unit.nm_unit')
->get();
But i wanna show all data from t_history_cuti where status = '2' too, without duplicate data from above query.
This is a display of the data above:
And this is the data expectation that I want:
Thanks a lot.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire