This commit is contained in:
2026-08-26 17:50:41 +08:00
parent d3866efcd8
commit f9adabf5d8
13 changed files with 10 additions and 29 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -65,7 +65,7 @@ class TicketService
private function applyScope($query, TicketScope $scope): void private function applyScope($query, TicketScope $scope): void
{ {
match ($scope->type) { match ($scope->type) {
'admin' => null, 'client' => null,
'staff' => $query->where(fn($q) => $q 'staff' => $query->where(fn($q) => $q
->where('status', Tickets::STATUS_UNASSIGNED) ->where('status', Tickets::STATUS_UNASSIGNED)
->where('user_id', $scope->staffId)), ->where('user_id', $scope->staffId)),
@@ -141,6 +141,8 @@ class TicketService
throw new \Exception('工单不存在'); throw new \Exception('工单不存在');
} }
// 提取 $allowFields 允许修改的字段 // 提取 $allowFields 允许修改的字段
$updateData = []; $updateData = [];
foreach ($allowFields as $field) { foreach ($allowFields as $field) {

View File

@@ -15,9 +15,12 @@ class Ticket extends BaseController
{ {
$isUser = Session::get('user_info.role') === 'user'; // 获取当前登录ID $isUser = Session::get('user_info.role') === 'user'; // 获取当前登录ID
$data = $this->request->post(); $post = $this->request->post();
$data = [
'datanum' => $post['datanum']
]
$allowFields = ['datanum', 'progress', 'status', 'remark', 'lock_time', 'user_id'];
try { try {
$result = $ticketService->updateTicket($id, $data, $allowFields, $isUser, false); $result = $ticketService->updateTicket($id, $data, $allowFields, $isUser, false);

View File

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

View File

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

View File

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