This commit is contained in:
2026-08-19 14:14:29 +08:00
parent 30ae8f813d
commit 07a24c5297
11 changed files with 66 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ use app\admin\middleware\Auth;
use app\middleware\CheckLogin;
Route::group(function () {
Route::get('ticketsfind', 'Ticket/ticketsFind');
Route::get('ticketsfind', 'Ticket/fetchTickets');
Route::post('addticket', 'Ticket/createTicket');
Route::put('ticket/:id', 'Ticket/updateTicket');
Route::delete('ticket/:id', 'Ticket/deleteTicket');

2
app/client/common.php Normal file
View File

@@ -0,0 +1,2 @@
<?php
// 这是系统自动生成的公共文件

View File

@@ -0,0 +1,26 @@
<?php
namespace app\client\controller;
use app\BaseController;
use app\index\service\ClientTicketService;
use think\facade\Session;
class Index extends BaseController
{
/**
* 获取客户关联工单
*/
public function fetchTickets(ClientTicketService $ClientTicketService)
{
$clientCompanyId = (int) Session::get('user_info.company_id'); // 获取当前登录客户ID
$canViewAll = Session::get('user_info.role') === 'client'
&& (bool) Session::get('user_info.can_view_all_tickets');
try {
$tickets = $ClientTicketService->getClientTickets($clientCompanyId, $canViewAll);
return $this->success('获取成功', $tickets);
} catch (\Exception $e) {
return $this->error($e->getMessage());
}
}
}

5
app/client/event.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的event定义文件
return [
];

View File

@@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的middleware定义文件
return [
];

View File

@@ -45,6 +45,6 @@ class Login extends BaseController
public function logout()
{
Session::clear();
return $this->success('退出成功');
return $this->success('退出登录');
}
}

2
app/staff/common.php Normal file
View File

@@ -0,0 +1,2 @@
<?php
// 这是系统自动生成的公共文件

View File

@@ -0,0 +1,12 @@
<?php
declare (strict_types = 1);
namespace app\staff\controller;
class Index
{
public function index()
{
return '您好!这是一个[staff]示例应用';
}
}

5
app/staff/event.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的event定义文件
return [
];

5
app/staff/middleware.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的middleware定义文件
return [
];

View File

@@ -4,7 +4,6 @@
// +----------------------------------------------------------------------
return [
// session name
'name' => 'PHPSESSID',
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '',