常用回复和直接回复功能

This commit is contained in:
2025-03-12 14:51:19 +08:00
parent 5ad1a04a98
commit b5a515b0ac
9 changed files with 311 additions and 23 deletions

View File

@ -3,6 +3,7 @@
namespace plugin\ticket\controller;
use plugin\points_mall\service\UserPointService;
use plugin\ticket\model\TicketCommonReply;
use plugin\ticket\model\TicketTicket;
use plugin\ticket\model\TicketType;
use plugin\ticket\model\TicketUserShare;
@ -59,6 +60,7 @@ class UserShare extends Controller
}
$this->type_list = TicketType::getList();
$this->user_list = SystemUser::query()->select();
$this->common_reply_list = TicketCommonReply::query()->scope(['avail'])->select();
$this->fetch('detail');
}
@ -75,6 +77,7 @@ class UserShare extends Controller
if ($userShare->isEmpty()) $this->error('用户随手拍不存在!');
if ($userShare->status !== 0) $this->error('用户随手拍已处理!');
$ticket_id = null;
$result = "已形成工单交由专人处理";
switch ($basic_data['_type']) {
case 'new':
$data = $this->_vali([
@ -112,6 +115,9 @@ class UserShare extends Controller
$ticket->source = $userShare;
$ticket->save();
break;
case 'skip':
$result = "已处理完毕";
break;
default:
$this->error('参数错误');
}
@ -121,6 +127,12 @@ class UserShare extends Controller
UserPointService::addUserPoint($userShare->user_id, $basic_data['point_aware'], '用户随手拍奖励积分');
$userShare->status = 1;
$userShare->save();
$adminInfo = $this->request->session('user');
$userShare->logs()->save([
'op_name' => $adminInfo["username"],
'content' => $basic_data['content'],
'result' => $result,
]);
$this->success('处理成功!');
}
}