Skip to content
Snippets Groups Projects
Commit bdfde11c authored by Peter Rotich's avatar Peter Rotich
Browse files

orm: Improve Dept's use of ORM

The commit also renames some fields in department table.
parent 96860fd9
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ if(!defined('OSTSTAFFINC') || !$thisstaff || !$thisstaff->isStaff()) die('Access
$qstr='';
$select='SELECT staff.*,CONCAT_WS(" ",firstname,lastname) as name,dept.name as dept ';
$from='FROM '.STAFF_TABLE.' staff '.
'LEFT JOIN '.DEPT_TABLE.' dept ON(staff.dept_id=dept.dept_id) ';
'LEFT JOIN '.DEPT_TABLE.' dept ON(staff.dept_id=dept.id) ';
$where='WHERE staff.isvisible=1 ';
$agents = Staff::objects()
......
......@@ -14,7 +14,7 @@ $from =' FROM '.TICKET_TABLE.' ticket '
.' LEFT JOIN '.USER_TABLE.' user ON user.id = ticket.user_id '
.' LEFT JOIN '.USER_EMAIL_TABLE.' email ON user.id = email.user_id '
.' LEFT JOIN '.USER_ACCOUNT_TABLE.' account ON (ticket.user_id=account.user_id) '
.' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id '
.' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.id '
.' LEFT JOIN '.STAFF_TABLE.' staff ON (ticket.staff_id=staff.staff_id) '
.' LEFT JOIN '.TEAM_TABLE.' team ON (ticket.team_id=team.team_id) '
.' LEFT JOIN '.TOPIC_TABLE.' topic ON (ticket.topic_id=topic.topic_id) '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment