From 96b6637814f242c7e2add2ab54c5413d27d432e9 Mon Sep 17 00:00:00 2001 From: mzl Date: Fri, 11 Jul 2025 17:16:45 +0800 Subject: [PATCH 1/2] Merge branch 'feature/mzl_dev' into develop --- app/common/controller/PresetController.php | 36 +++++++++++++++++++++ app/common/logic/CorpFeishuAppLogic.php | 16 +++++++++ app/common/logic/CorpLogic.php | 14 ++++++++ app/common/service/CorpFeishuAppService.php | 21 ++++++++++++ app/common/service/CorpService.php | 24 ++++++++++++++ config/route.php | 5 +++ config/whitelist.php | 8 +++-- 7 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 app/common/controller/PresetController.php create mode 100644 app/common/logic/CorpFeishuAppLogic.php create mode 100644 app/common/logic/CorpLogic.php create mode 100644 app/common/service/CorpFeishuAppService.php create mode 100644 app/common/service/CorpService.php diff --git a/app/common/controller/PresetController.php b/app/common/controller/PresetController.php new file mode 100644 index 0000000..964b2a6 --- /dev/null +++ b/app/common/controller/PresetController.php @@ -0,0 +1,36 @@ +getList(); + return $this->success($result, '获取公司列表'); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } + + + + public function feishuApp(Request $request) + { + try { + $corpId = $request->get('corp_id'); + $result = (new CorpFeishuAppService())->getFeishuApp($corpId); + return $this->success($result, '获取飞书应用信息'); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } +} \ No newline at end of file diff --git a/app/common/logic/CorpFeishuAppLogic.php b/app/common/logic/CorpFeishuAppLogic.php new file mode 100644 index 0000000..2073aac --- /dev/null +++ b/app/common/logic/CorpFeishuAppLogic.php @@ -0,0 +1,16 @@ +first(['id', 'corp_id', 'name', 'app_id', 'r_url', 'state']); + } + +} \ No newline at end of file diff --git a/app/common/logic/CorpLogic.php b/app/common/logic/CorpLogic.php new file mode 100644 index 0000000..cac9672 --- /dev/null +++ b/app/common/logic/CorpLogic.php @@ -0,0 +1,14 @@ +orderBy('sort', 'asc')->get(['id', 'name', 'abbr', 'tenant_key']); + } +} \ No newline at end of file diff --git a/app/common/service/CorpFeishuAppService.php b/app/common/service/CorpFeishuAppService.php new file mode 100644 index 0000000..0c10be8 --- /dev/null +++ b/app/common/service/CorpFeishuAppService.php @@ -0,0 +1,21 @@ +logic = (new CorpFeishuAppLogic()); + } + + public function getFeishuApp(int $corpId) + { + return $this->logic->getFeishuApp($corpId); + } +} \ No newline at end of file diff --git a/app/common/service/CorpService.php b/app/common/service/CorpService.php new file mode 100644 index 0000000..7d18d49 --- /dev/null +++ b/app/common/service/CorpService.php @@ -0,0 +1,24 @@ +logic = (new CorpLogic()); + } + + /** + * 获取公司list + */ + public function getList() + { + return $this->logic->getList(); + } +} \ No newline at end of file diff --git a/config/route.php b/config/route.php index b87f54a..94f8269 100644 --- a/config/route.php +++ b/config/route.php @@ -41,6 +41,11 @@ Route::group('/common', function () { Route::group('/user', function () { Route::any('/info', [app\common\controller\UserController::class, 'info']); }); + + Route::group('/preset', function () { + Route::any('/corps', [app\common\controller\PresetController::class, 'corps']); + Route::any('/feishu/app', [app\common\controller\PresetController::class, 'feishuApp']); + }); }); Route::group('/admin', function () { diff --git a/config/whitelist.php b/config/whitelist.php index d1669b3..e601d30 100644 --- a/config/whitelist.php +++ b/config/whitelist.php @@ -2,8 +2,10 @@ return [ 'basi_cdata' => [ - '/', - '/index/index', - '/index/view' + '/', // 首页 + '/index/index', // 首页 + '/index/view', // 飞书调试 + '/common/preset/corps', // 公司列表 + '/common/preset/feishu/app', // 飞书应用信息 ] ]; \ No newline at end of file From 17612a02dd666921a129f19115f34e8e84296845 Mon Sep 17 00:00:00 2001 From: "HESU\\HESU" <1696136552@qq.com> Date: Fri, 11 Jul 2025 17:49:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/controller/TicketController.php | 2 +- app/ticket/service/CategorieService.php | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/ticket/controller/TicketController.php b/app/ticket/controller/TicketController.php index defd5af..3eb3222 100644 --- a/app/ticket/controller/TicketController.php +++ b/app/ticket/controller/TicketController.php @@ -31,7 +31,7 @@ class TicketController extends BaseController return $this->success($result); // return $this->success($this->page($result)); } catch (\Throwable $e) { - return $this->error($e->getMessage().' '.$e->getLine().' '.$e->getFile().' '.$e->getTraceAsString()); + return $this->error($e->getMessage()); } } diff --git a/app/ticket/service/CategorieService.php b/app/ticket/service/CategorieService.php index d769a58..902ad54 100644 --- a/app/ticket/service/CategorieService.php +++ b/app/ticket/service/CategorieService.php @@ -5,6 +5,7 @@ namespace app\ticket\service; use app\queue\translation\service\TranslationService; use app\queue\utils\Translat; use app\ticket\logic\CategorieLogic; +use app\ticket\model\CategorieTranslation; use support\Db; use support\exception\BusinessException; @@ -69,10 +70,17 @@ class CategorieService $result = (new CategorieLogic())->edit($data); - (new TranslationService())->queueTranslations( - 'ticket_categorie', - $data['id'], - $sourceLocale, +// (new TranslationService())->queueTranslations( +// 'ticket_categorie', +// $data['id'], +// $sourceLocale, +// $traitsourceFields +// ); + CategorieTranslation::updateOrCreate( + [ + 'model_id' => $data['id'], + 'locale' => $sourceLocale, + ], $traitsourceFields ); Db::commit();