Compare commits
1 Commits
d3866efcd8
...
fix/login-
| Author | SHA1 | Date | |
|---|---|---|---|
| f9adabf5d8 |
@@ -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]示例应用';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
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) {
|
||||||
|
|||||||
@@ -15,10 +15,13 @@ 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();
|
||||||
|
|
||||||
$allowFields = ['datanum', 'progress', 'status', 'remark', 'lock_time', 'user_id'];
|
$data = [
|
||||||
|
'datanum' => $post['datanum']
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $ticketService->updateTicket($id, $data, $allowFields, $isUser, false);
|
$result = $ticketService->updateTicket($id, $data, $allowFields, $isUser, false);
|
||||||
return $this->success('更新成功', $result);
|
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