Merged in bugfix/PMCORE-3181 (pull request #8002)
PMCORE-3181 Improvement in CaseList endpoints Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
dbba9494b8
@@ -62,7 +62,8 @@ class CaseList extends Model
|
|||||||
'USR_FIRSTNAME' => 'userFirstname',
|
'USR_FIRSTNAME' => 'userFirstname',
|
||||||
'USR_LASTNAME' => 'userLastname',
|
'USR_LASTNAME' => 'userLastname',
|
||||||
'USR_EMAIL' => 'userEmail',
|
'USR_EMAIL' => 'userEmail',
|
||||||
'ADD_TAB_NAME' => 'tableName'
|
'ADD_TAB_NAME' => 'tableName',
|
||||||
|
'PRO_TITLE' => 'process'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -180,19 +181,18 @@ class CaseList extends Model
|
|||||||
$model = CaseList::where('CAL_TYPE', '=', $type)
|
$model = CaseList::where('CAL_TYPE', '=', $type)
|
||||||
->leftJoin('USERS', 'USERS.USR_ID', '=', 'CASE_LIST.USR_ID')
|
->leftJoin('USERS', 'USERS.USR_ID', '=', 'CASE_LIST.USR_ID')
|
||||||
->leftJoin('ADDITIONAL_TABLES', 'ADDITIONAL_TABLES.ADD_TAB_UID', '=', 'CASE_LIST.ADD_TAB_UID')
|
->leftJoin('ADDITIONAL_TABLES', 'ADDITIONAL_TABLES.ADD_TAB_UID', '=', 'CASE_LIST.ADD_TAB_UID')
|
||||||
|
->leftJoin('PROCESS', 'PROCESS.PRO_UID', '=', 'ADDITIONAL_TABLES.PRO_UID')
|
||||||
->select([
|
->select([
|
||||||
'CASE_LIST.*',
|
'CASE_LIST.*',
|
||||||
'USERS.USR_UID', 'USERS.USR_USERNAME', 'USERS.USR_FIRSTNAME', 'USERS.USR_LASTNAME', 'USERS.USR_EMAIL',
|
'PROCESS.PRO_TITLE',
|
||||||
'ADDITIONAL_TABLES.ADD_TAB_NAME'
|
'ADDITIONAL_TABLES.ADD_TAB_NAME',
|
||||||
|
'USERS.USR_UID', 'USERS.USR_USERNAME', 'USERS.USR_FIRSTNAME', 'USERS.USR_LASTNAME', 'USERS.USR_EMAIL'
|
||||||
])
|
])
|
||||||
->where(function ($query) use ($search) {
|
->where(function ($query) use ($search) {
|
||||||
$query
|
$query
|
||||||
->orWhere('CASE_LIST.CAL_NAME', 'like', '%' . $search . '%')
|
->orWhere('CASE_LIST.CAL_NAME', 'like', '%' . $search . '%')
|
||||||
->orWhere('CASE_LIST.CAL_DESCRIPTION', 'like', '%' . $search . '%')
|
->orWhere('PROCESS.PRO_TITLE', 'like', '%' . $search . '%')
|
||||||
->orWhere('USERS.USR_USERNAME', 'like', '%' . $search . '%')
|
->orWhere('ADDITIONAL_TABLES.ADD_TAB_NAME', 'like', '%' . $search . '%');
|
||||||
->orWhere('USERS.USR_FIRSTNAME', 'like', '%' . $search . '%')
|
|
||||||
->orWhere('USERS.USR_LASTNAME', 'like', '%' . $search . '%')
|
|
||||||
->orWhere('USERS.USR_EMAIL', 'like', '%' . $search . '%');
|
|
||||||
})
|
})
|
||||||
->orderBy('CASE_LIST.CAL_NAME', $order);
|
->orderBy('CASE_LIST.CAL_NAME', $order);
|
||||||
|
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ class CaseList extends Api
|
|||||||
* Get inbox Case List settings.
|
* Get inbox Case List settings.
|
||||||
* @url GET /inbox
|
* @url GET /inbox
|
||||||
* @param string $search
|
* @param string $search
|
||||||
* @param string $offset
|
* @param int $offset
|
||||||
* @param string $limit
|
* @param int $limit
|
||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
* @return array
|
* @return array
|
||||||
@@ -107,8 +107,8 @@ class CaseList extends Api
|
|||||||
* Get draft Case List settings.
|
* Get draft Case List settings.
|
||||||
* @url GET /draft
|
* @url GET /draft
|
||||||
* @param string $search
|
* @param string $search
|
||||||
* @param string $offset
|
* @param int $offset
|
||||||
* @param string $limit
|
* @param int $limit
|
||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
* @return array
|
* @return array
|
||||||
@@ -122,8 +122,8 @@ class CaseList extends Api
|
|||||||
* Get paused Case List settings.
|
* Get paused Case List settings.
|
||||||
* @url GET /paused
|
* @url GET /paused
|
||||||
* @param string $search
|
* @param string $search
|
||||||
* @param string $offset
|
* @param int $offset
|
||||||
* @param string $limit
|
* @param int $limit
|
||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
* @return array
|
* @return array
|
||||||
@@ -137,13 +137,13 @@ class CaseList extends Api
|
|||||||
* Get unassigned Case List settings.
|
* Get unassigned Case List settings.
|
||||||
* @url GET /unassigned
|
* @url GET /unassigned
|
||||||
* @param string $search
|
* @param string $search
|
||||||
* @param string $offset
|
* @param int $offset
|
||||||
* @param string $limit
|
* @param int $limit
|
||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function doGetUnassigned(string $search, int $offset, int $limit)
|
public function doGetUnassigned(string $search = '', int $offset = 0, int $limit = 10)
|
||||||
{
|
{
|
||||||
return CaseListBusinessModel::getSetting('unassigned', $search, $offset, $limit);
|
return CaseListBusinessModel::getSetting('unassigned', $search, $offset, $limit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user