From 4376c668bab61be2a858deda6fc6b44d2e40d7a3 Mon Sep 17 00:00:00 2001 From: mzl Date: Sun, 12 Oct 2025 17:40:37 +0800 Subject: [PATCH] Merge branch 'master' into develop # Conflicts: # app/common/utils/WsEvents.php # app/controller/IndexController.php --- app/common/utils/WsEvents.php | 2 +- app/controller/IndexController.php | 26 ++++++++++++++++++------ app/crmAdmin/service/CustomerService.php | 9 ++++++-- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/app/common/utils/WsEvents.php b/app/common/utils/WsEvents.php index 64ecd4f..e539831 100644 --- a/app/common/utils/WsEvents.php +++ b/app/common/utils/WsEvents.php @@ -291,7 +291,7 @@ class WsEvents { $ly = [ 1 => 186, - 3 => 226, + 3 => 224, ]; if ($num === 0) { diff --git a/app/controller/IndexController.php b/app/controller/IndexController.php index 2d51caa..1d354c8 100644 --- a/app/controller/IndexController.php +++ b/app/controller/IndexController.php @@ -99,18 +99,32 @@ class IndexController return $result; } + /** + * 菜单迁移 + */ + public function doMenu() + { + // 菜单迁移 (部分) + $where[] = ['id', '>', 239]; + (new \app\common\utils\MigrationResources())->do('resources', 'resources_20251012_bak', $where); + + // 整体 + // $list = (new \app\common\utils\MigrationResources())->getFullResourceTreeOptimized('resources_20250916_bak', []); + // var_dump($list); + } + public function test(Request $request) { // $chain = \app\common\service\MenuBadgeService::buildBadgeChain(menuId: 226, leafCount: rand(1, 10)); // (new \app\common\utils\WsEvents())->pushWebsocket('approval.todo.counts', 74, $chain); - $data = [ - 'event' => 'approval.todo.counts', - 'user_id' => 74, - 'num' => rand(1, 10), - ]; - \Webman\RedisQueue\Redis::send('ws-msg', $data); + // $data = [ + // 'event' => 'approval.todo.counts', + // 'user_id' => 74, + // 'num' => rand(1, 10), + // ]; + // \Webman\RedisQueue\Redis::send('ws-msg', $data); return json(['code' => 0, 'msg' => 'success']); } diff --git a/app/crmAdmin/service/CustomerService.php b/app/crmAdmin/service/CustomerService.php index 56d42f1..0ba9a31 100644 --- a/app/crmAdmin/service/CustomerService.php +++ b/app/crmAdmin/service/CustomerService.php @@ -135,6 +135,7 @@ class CustomerService $customer = $query->orderBy('id', 'desc')->paginate($perPage, ['*'], 'page', $page); } else { $customer = $query->orderBy('id', 'desc')->get(); + return $customer; } if (!$export) { @@ -176,7 +177,7 @@ class CustomerService public function export($params) { - if(empty($params['user_id']) && empty($params['tag_id'])){ + if(empty($params['user_id']) && empty($params['tag_id']) && empty($params['channel_id'])){ $params['user_id'] = 0; } $customers = $this->search($params, true); @@ -198,6 +199,8 @@ class CustomerService 'I1' => '描述', 'J1' => '所属人', 'K1' => '录入人', + 'L1' => '详情', + 'M1' => '录入时间', ]; // 设置表头样式 @@ -227,7 +230,7 @@ class CustomerService ], ]; - $sheet->getStyle('A1:K1')->applyFromArray($headerStyle); + $sheet->getStyle('A1:M1')->applyFromArray($headerStyle); // 填充数据 $row = 2; @@ -247,6 +250,8 @@ class CustomerService $sheet->setCellValue('I' . $row, $customerData['describe']); $sheet->setCellValue('J' . $row, $customerData['user_name']); // 所属人姓名 $sheet->setCellValue('K' . $row, $customerData['enter_user_name']); + $sheet->setCellValue('L' . $row, strip_tags($customerData['desc_collect'])); + $sheet->setCellValue('M' . $row, $customerData['created_at']->toDateTimeString()); $row++; }