wip
This commit is contained in:
@@ -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]示例应用';
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<?php
|
||||
// 这是系统自动生成的公共文件
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
// 这是系统自动生成的event定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<?php
|
||||
// 这是系统自动生成的公共文件
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
// 这是系统自动生成的event定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
|
||||
];
|
||||
Reference in New Issue
Block a user