diff --git a/app/Controllers/Location.php b/app/Controllers/Location.php index 0a97a48..dff6960 100644 --- a/app/Controllers/Location.php +++ b/app/Controllers/Location.php @@ -20,7 +20,7 @@ class Location extends Controller { $rows = $this->db->table('location l') ->select("l.LocationID, LocCode, Parent, LocFull, LocType, v.VDesc ") ->join("locationaddress la", "l.LocationID=la.LocationID", 'left') - ->join("valueset v", "v.VSetID=12 and v.VValue=l.LocType", 'left') + ->join("valueset v", "v.VSetID=12 and v.VID=l.loctype", 'left') ->get()->getResultArray(); if (empty($rows)) { @@ -42,7 +42,7 @@ class Location extends Controller { $rows = $this->db->table('location l') ->select("l.*, la.*, v.*") ->join("locationaddress la", "l.LocationID=la.LocationID", "left") - ->join("valueset v", "v.VSetID=12 and v.VValue=l.loctype", "left") + ->join("valueset v", "v.VSetID=12 and v.VID=l.loctype", "left") ->where('l.LocationID', (int) $LocationID) ->get()->getResultArray(); @@ -192,6 +192,7 @@ class Location extends Controller { "LocCode" => $input['LocCode'] ?? null, "Parent" => $input['Parent'] ?? null, "LocFull" => $input['LocFull'] ?? null, + "LocType" => $input['LocType'] ?? null, "Description" => $input['Description'] ?? null, ];