Compare commits

..

1 Commits

Author SHA1 Message Date
f9adabf5d8 wip 2026-08-26 17:50:41 +08:00
13 changed files with 10 additions and 29 deletions

View File

@@ -1,12 +1,12 @@
<?php
declare (strict_types = 1);
namespace app\staff\controller;
namespace app\api\controller;
class 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
{
match ($scope->type) {
'admin' => null,
'client' => null,
'staff' => $query->where(fn($q) => $q
->where('status', Tickets::STATUS_UNASSIGNED)
->where('user_id', $scope->staffId)),
@@ -141,6 +141,8 @@ class TicketService
throw new \Exception('工单不存在');
}
// 提取 $allowFields 允许修改的字段
$updateData = [];
foreach ($allowFields as $field) {

View File

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

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 [
];