From 722a79b58bd2a55370e55b1216597e1dea4a0f8e Mon Sep 17 00:00:00 2001 From: mzl Date: Sat, 23 Aug 2025 13:55:55 +0800 Subject: [PATCH 1/6] Merge branch 'develop' --- config/plugin/webman/gateway-worker/process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/plugin/webman/gateway-worker/process.php b/config/plugin/webman/gateway-worker/process.php index 5c7efaa..64796e9 100644 --- a/config/plugin/webman/gateway-worker/process.php +++ b/config/plugin/webman/gateway-worker/process.php @@ -7,7 +7,7 @@ use Webman\GatewayWorker\Register; return [ 'gateway' => [ 'handler' => Gateway::class, - 'listen' => 'websocket://0.0.0.0:5151', + 'listen' => 'websocket://0.0.0.0:' . getenv('GATEWAY_LISTEN'), 'count' => 2, 'reloadable' => false, 'constructor' => ['config' => [ From d5c16d44acd580ebc515b02c9766057b81ba73df Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 25 Aug 2025 09:55:12 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/crm/utils/Util.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/crm/utils/Util.php b/app/crm/utils/Util.php index 586ee45..0701f5e 100644 --- a/app/crm/utils/Util.php +++ b/app/crm/utils/Util.php @@ -126,9 +126,14 @@ class Util public static function mask($str) { + $length = strlen($str); + if(empty($str)){ return ''; } + if($length <= 6){ + return $str; + } return substr($str, 0, 3) . '****' . substr($str, -4); } From 4d8b54722f4ec49f16e39549bf88cbaad4d77ce3 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 25 Aug 2025 14:30:38 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/service/ConversationService.php | 48 +++++++++++++++------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/app/ticket/service/ConversationService.php b/app/ticket/service/ConversationService.php index ea97cef..5b0bef9 100644 --- a/app/ticket/service/ConversationService.php +++ b/app/ticket/service/ConversationService.php @@ -3,6 +3,7 @@ namespace app\ticket\service; use app\common\model\User; +use app\common\service\MessageNotificationsService; use app\common\service\OssService; use app\ticket\logic\CategorieLogic; use app\ticket\logic\ConversationLogic; @@ -55,41 +56,60 @@ class ConversationService $categorie= (new CategorieLogic())->find($ticket['categorie_id']); $categorieName = isset($categorie['translation']) ? $categorie['translation']['name'] : ''; - $notice = [ - 'code' => $ticket['code'], - 'category' => $categorieName, - 'content' => $data['content'], - 'reply' => '', - ]; +// $notice = [ +// 'code' => $ticket['code'], +// 'category' => $categorieName, +// 'content' => $data['content'], +// 'reply' => '', +// ]; //$emailDefault = 'app@hnxinyouhe.com'; //公共邮箱 //$emailDefault = 'support@hnxinyouhe.com'; //公共邮箱 $emailDefault = env('TICKET_EMAIL_DEFAULT'); - if (empty($conversation)) { + $userDefault = [1, 75, 78]; + if (empty($conversation)) { //没有沟通记录 + $title = '新工单提醒-'.$categorieName; $email = $emailDefault; + $notice_user_id = $userDefault; }else{ + $title = '工单回复'; $tiket = (new TicketLogic())->find($conversation['ticket_id']); if($data['user_id'] != $tiket['user_id']){ - $email = User::where('id',$tiket['user_id'])->value('email'); + //$email = User::where('id',$tiket['user_id'])->value('email'); + $notice_user_id = [$tiket['user_id']]; }else{ $conversationLast = Conversation::where('ticket_id', '=', $conversation['ticket_id']) ->where('user_id', '!=', $data['user_id']) ->orderBy('id', 'desc') ->first(); - $email = (!empty($conversationLast['user_id']))?User::where('id',$conversationLast['user_id'])->value('email',$emailDefault):$emailDefault; + //$email = (!empty($conversationLast['user_id']))?User::where('id',$conversationLast['user_id'])->value('email',$emailDefault):$emailDefault; + $notice_user_id = (!empty($conversationLast['user_id']))? [$conversationLast['user_id']]:$userDefault; } - $notice['content'] = $tiket['content']; + //$notice['content'] = $tiket['content']; + $tiket_content = $tiket['content']; $status_fanyi = array_map(fn($v) => "{{{$v}}}", array_flip(Constants::TICKET_STATUS)); $locale = locale(); $ticket_status = $locale == 'zh'? Constants::TICKET_STATUS_ZH:Constants::TICKET_STATUS_EN; $content = str_replace($status_fanyi,$ticket_status,$data['content']); - $notice['reply'] = '
  • 最新回复:' . $content . '
  • '; - } - if(!empty($emailDefault)){ - \app\common\utils\email\MailSend::send($email, '【XYH】新的工单提醒', replaceTpl($notice, 'work_order')); + //$notice['reply'] = '
  • 最新回复:' . $content . '
  • '; + $reply = $content?($content.'\n'.'工单内容:'):'' ; } +// if(!empty($emailDefault)){ +// \app\common\utils\email\MailSend::send($email, '【XYH】新的工单提醒', replaceTpl($notice, 'work_order')); +// } + $notice = ['sender_id' => 0, //发送人ID 0默认系统 + 'sender_type' => 'system', //发送者类型 user admin system + 'title' => $title, //标题 + 'content' => $reply . $tiket_content, //内容 + 'scene' => 1, //场景 0系统公共 1系统通知 + 'recipient' => $notice_user_id, //接收人 空为全部 + 'push_method' => 0 //推送方式0系统推送1手动推送 + ]; + + // 异步推送 + \Webman\RedisQueue\Redis::send('notice', $notice); unset($data['categorie_id']); unset($data['code']); From 7a9999508c30505c3e033dd6f61ae6380920a7de Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 25 Aug 2025 14:32:14 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=8F=90=E9=86=92?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/service/ConversationService.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/app/ticket/service/ConversationService.php b/app/ticket/service/ConversationService.php index 5b0bef9..b07ef3c 100644 --- a/app/ticket/service/ConversationService.php +++ b/app/ticket/service/ConversationService.php @@ -55,26 +55,15 @@ class ConversationService $ticket = (new TicketLogic())->find($data['ticket_id']); $categorie= (new CategorieLogic())->find($ticket['categorie_id']); $categorieName = isset($categorie['translation']) ? $categorie['translation']['name'] : ''; - -// $notice = [ -// 'code' => $ticket['code'], -// 'category' => $categorieName, -// 'content' => $data['content'], -// 'reply' => '', -// ]; - //$emailDefault = 'app@hnxinyouhe.com'; //公共邮箱 - //$emailDefault = 'support@hnxinyouhe.com'; //公共邮箱 - $emailDefault = env('TICKET_EMAIL_DEFAULT'); + $userDefault = [1, 75, 78]; if (empty($conversation)) { //没有沟通记录 $title = '新工单提醒-'.$categorieName; - $email = $emailDefault; $notice_user_id = $userDefault; }else{ $title = '工单回复'; $tiket = (new TicketLogic())->find($conversation['ticket_id']); if($data['user_id'] != $tiket['user_id']){ - //$email = User::where('id',$tiket['user_id'])->value('email'); $notice_user_id = [$tiket['user_id']]; }else{ $conversationLast = Conversation::where('ticket_id', '=', $conversation['ticket_id']) @@ -82,10 +71,8 @@ class ConversationService ->orderBy('id', 'desc') ->first(); - //$email = (!empty($conversationLast['user_id']))?User::where('id',$conversationLast['user_id'])->value('email',$emailDefault):$emailDefault; $notice_user_id = (!empty($conversationLast['user_id']))? [$conversationLast['user_id']]:$userDefault; } - //$notice['content'] = $tiket['content']; $tiket_content = $tiket['content']; $status_fanyi = array_map(fn($v) => "{{{$v}}}", array_flip(Constants::TICKET_STATUS)); @@ -93,12 +80,9 @@ class ConversationService $ticket_status = $locale == 'zh'? Constants::TICKET_STATUS_ZH:Constants::TICKET_STATUS_EN; $content = str_replace($status_fanyi,$ticket_status,$data['content']); - //$notice['reply'] = '
  • 最新回复:' . $content . '
  • '; $reply = $content?($content.'\n'.'工单内容:'):'' ; } -// if(!empty($emailDefault)){ -// \app\common\utils\email\MailSend::send($email, '【XYH】新的工单提醒', replaceTpl($notice, 'work_order')); -// } + $notice = ['sender_id' => 0, //发送人ID 0默认系统 'sender_type' => 'system', //发送者类型 user admin system 'title' => $title, //标题 From e3a20d8f85d5370cbf98f5b1d666803c40948a26 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 25 Aug 2025 14:36:01 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=8F=90=E9=86=92?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/service/ConversationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ticket/service/ConversationService.php b/app/ticket/service/ConversationService.php index b07ef3c..d326d6b 100644 --- a/app/ticket/service/ConversationService.php +++ b/app/ticket/service/ConversationService.php @@ -86,7 +86,7 @@ class ConversationService $notice = ['sender_id' => 0, //发送人ID 0默认系统 'sender_type' => 'system', //发送者类型 user admin system 'title' => $title, //标题 - 'content' => $reply . $tiket_content, //内容 + 'content' => ($reply??'') . $tiket_content, //内容 'scene' => 1, //场景 0系统公共 1系统通知 'recipient' => $notice_user_id, //接收人 空为全部 'push_method' => 0 //推送方式0系统推送1手动推送 From 341dae491d782587da1f32ef6c17bd024c633fe0 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 25 Aug 2025 14:40:34 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=8F=90=E9=86=92?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/service/ConversationService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/ticket/service/ConversationService.php b/app/ticket/service/ConversationService.php index d326d6b..852fc0c 100644 --- a/app/ticket/service/ConversationService.php +++ b/app/ticket/service/ConversationService.php @@ -57,6 +57,7 @@ class ConversationService $categorieName = isset($categorie['translation']) ? $categorie['translation']['name'] : ''; $userDefault = [1, 75, 78]; + $tiket_content = $ticket['content']; if (empty($conversation)) { //没有沟通记录 $title = '新工单提醒-'.$categorieName; $notice_user_id = $userDefault;