first commit
This commit is contained in:
29
app/index/controller/Ticket.php
Normal file
29
app/index/controller/Ticket.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\service\TicketService;
|
||||
use think\facade\Session;
|
||||
|
||||
class Ticket extends BaseController
|
||||
{
|
||||
/**
|
||||
* 更新工单(前台调用)
|
||||
*/
|
||||
public function updateTicket(TicketService $ticketService, $id)
|
||||
{
|
||||
|
||||
$adminId = Session::get('id'); // 获取当前登录ID
|
||||
$data = $this->request->post();
|
||||
|
||||
$allowFields = ['datanum', 'progress', 'status', 'remark', 'lock_time'];
|
||||
|
||||
try {
|
||||
$result = $ticketService->updateTicket($id, $data, $allowFields, $adminId, false);
|
||||
return json(['code' => 200, 'msg' => '更新成功', 'data' => $result]);
|
||||
} catch (\Exception $e) {
|
||||
return json(['code' => 400, 'msg' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user