我的工单
This commit is contained in:
@@ -17,6 +17,24 @@ class TicketController extends BaseController
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的工单
|
||||
* @param Request $request
|
||||
* @return \support\Response
|
||||
*/
|
||||
public function self(Request $request)
|
||||
{
|
||||
try {
|
||||
$request->setGet('user_id',$request->user->uid);
|
||||
$result = (new TicketService())->list($request->all());
|
||||
return $this->success($result);
|
||||
// return $this->success($this->page($result));
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage().' '.$e->getLine().' '.$e->getFile().' '.$e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
public function add(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -20,11 +20,15 @@ class TicketLogic
|
||||
if(!empty($params['categorie_id'])){
|
||||
$where[] = ['categorie_id', '=', $params['categorie_id']];
|
||||
}
|
||||
if(!empty($params['user_id'])){
|
||||
$where[] = ['user_id', '=', $params['user_id']];
|
||||
}
|
||||
if(!empty($params['status'])){
|
||||
$where[] = ['status', '=', $params['status']];
|
||||
}
|
||||
$size = $params['size'];
|
||||
$current = $params['current'];
|
||||
|
||||
return Ticket::with('attachments')->with('categorie')->with('categorie.translation')->where($where)->orderBy('id','desc')->paginate($size, ['*'], 'page', $current);
|
||||
}
|
||||
public function add(array $data)
|
||||
|
||||
@@ -59,6 +59,7 @@ Route::group('/ticket', function () {
|
||||
Route::any('/ticket/add', [app\ticket\controller\TicketController::class, 'add']);
|
||||
Route::any('/ticket/edit', [app\ticket\controller\TicketController::class, 'edit']);
|
||||
Route::any('/ticket/list', [app\ticket\controller\TicketController::class, 'index']);
|
||||
Route::any('/ticket/self', [app\ticket\controller\TicketController::class, 'self']);
|
||||
Route::any('/ticket/status', [app\ticket\controller\TicketController::class, 'status']);
|
||||
Route::any('/ticket/getStatus', [app\ticket\controller\TicketController::class, 'getStatus']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user