工单附件
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\ticket\service;
|
||||
|
||||
use app\common\service\OssService;
|
||||
use app\ticket\logic\ConversationLogic;
|
||||
use config\constants\Constants;
|
||||
use support\Db;
|
||||
@@ -19,8 +20,13 @@ class ConversationService
|
||||
$result = (new ConversationLogic())->list($params);
|
||||
|
||||
$status_fanyi = array_map(fn($v) => "{{{$v}}}", array_flip(Constants::TICKET_STATUS));
|
||||
$ossservice = new OssService();
|
||||
foreach ($result as $key => $value) {
|
||||
$result[$key]['content'] = str_replace($status_fanyi,$ticket_status,$value['content']);
|
||||
$result[$key]['attachment'] = explode(",", $value['attachment']);
|
||||
foreach ($result[$key]['attachment'] as $k => $attachment) {
|
||||
$result[$key]['attachment_full'][$k] = (!empty($attachment))?$ossservice->generatePrivateUrl($attachment):'';
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -28,6 +34,7 @@ class ConversationService
|
||||
public function add(array $data)
|
||||
{
|
||||
try {
|
||||
$data['attachment'] = implode(",", $data['attachment']);
|
||||
return (new ConversationLogic())->add($data);
|
||||
} catch (\Throwable $e) {
|
||||
throw $e;
|
||||
@@ -38,6 +45,7 @@ class ConversationService
|
||||
{
|
||||
try {
|
||||
Db::beginTransaction();
|
||||
$data['attachment'] = implode(",", $data['attachment']);
|
||||
$result = (new ConversationLogic())->edit($data);
|
||||
Db::commit();
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user