mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
Guillermo - staff-un-assign-ticket[skip ci]
This commit is contained in:
parent
73633278e6
commit
d9124eb21a
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
use Respect\Validation\Validator as DataValidator;
|
use Respect\Validation\Validator as DataValidator;
|
||||||
|
|
||||||
class GetNewTicketsStaffControllers extends Controller {
|
class GetNewTicketsStaffController extends Controller {
|
||||||
const PATH = '/get-new-tickets';
|
const PATH = '/get-new-tickets';
|
||||||
|
|
||||||
public function validations() {
|
public function validations() {
|
||||||
@ -10,8 +10,17 @@ class GetNewTicketsStaffControllers extends Controller {
|
|||||||
'requestData' => []
|
'requestData' => []
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handler() {
|
public function handler() {
|
||||||
|
$user = Controller::getLoggedUser();
|
||||||
|
$query = ' (';
|
||||||
|
foreach ($user->sharedDepartmentList as $department) {
|
||||||
|
$query .= 'department_id=' . $department->id . ' OR ';
|
||||||
|
}
|
||||||
|
$query = substr($query,0,-3);
|
||||||
|
$query .= ') AND owner_id IS NULL';
|
||||||
|
|
||||||
|
$ticketList = Ticket::find($query);
|
||||||
|
|
||||||
|
Response::respondSuccess($ticketList->toArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -30,6 +30,11 @@ abstract class DataStore {
|
|||||||
|
|
||||||
return $dataStoreList;
|
return $dataStoreList;
|
||||||
}
|
}
|
||||||
|
public static function find($query) {
|
||||||
|
$beanList = RedBean::find(static::TABLE,$query);
|
||||||
|
|
||||||
|
return DataStoreList::getList(ucfirst(static::TABLE),$beanList);
|
||||||
|
}
|
||||||
|
|
||||||
private static function validateProp($propToValidate) {
|
private static function validateProp($propToValidate) {
|
||||||
$validProp = false;
|
$validProp = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user