PMCORE-3000
This commit is contained in:
@@ -38,11 +38,10 @@ class ProcessUser extends Model
|
|||||||
*/
|
*/
|
||||||
public function scopeProcessGroupSupervisor($query, $userUid)
|
public function scopeProcessGroupSupervisor($query, $userUid)
|
||||||
{
|
{
|
||||||
$query->where('PU_TYPE', 'GROUP_SUPERVISOR');
|
// Ge the groups related to the user, Todo, implement the field PROCESS_USER.GRP_ID
|
||||||
$query->leftJoin('GROUP_USER', function ($leftJoin) use ($userUid) {
|
$groups = GroupUser::getGroups($userUid, 'GRP_UID');
|
||||||
$leftJoin->on('PROCESS_USER.USR_UID', '=', 'GROUP_USER.GRP_UID')
|
$query->where('PROCESS_USER.PU_TYPE', 'GROUP_SUPERVISOR');
|
||||||
->where('GROUP_USER.USR_UID', $userUid);
|
$query->whereIn('PROCESS_USER.USR_UID', $groups);
|
||||||
});
|
|
||||||
$query->joinProcess();
|
$query->joinProcess();
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
|
|||||||
Reference in New Issue
Block a user