27 lines
820 B
PHP
27 lines
820 B
PHP
<?php
|
|
|
|
namespace app\index\controller;
|
|
|
|
use app\BaseController;
|
|
use app\index\service\ClientTicketService;
|
|
use think\facade\Session;
|
|
|
|
class ClientTicket extends BaseController
|
|
{
|
|
/**
|
|
* 获取客户关联工单
|
|
*/
|
|
public function getClientTickets(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());
|
|
}
|
|
}
|
|
}
|