change loctype to vvalue

This commit is contained in:
mahdahar 2025-09-22 16:43:49 +07:00
parent 4c2d4e55e4
commit 25dc76b7b9

View File

@ -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.VID=l.loctype", 'left')
->join("valueset v", "v.VSetID=12 and v.VValue=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.VID=l.loctype", "left")
->join("valueset v", "v.VSetID=12 and v.VValue=l.loctype", "left")
->where('l.LocationID', (int) $LocationID)
->get()->getResultArray();