From 9cf4785d489e0f572ddfb82d83add3e9de0d281d Mon Sep 17 00:00:00 2001 From: "zhangf@suq.cn" Date: Tue, 9 Dec 2025 15:00:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E6=96=B0=E5=A2=9E=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E7=94=BB=E5=83=8F=E5=92=8C=E7=9F=A5=E8=AF=86=E5=BA=93?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/EnterprisePortraitCategoryController.php | 5 ++++- app/controller/KnowledgeLibraryController.php | 4 ++++ app/route/route.php | 5 +++++ app/service/EnterprisePortraitCategoryService.php | 8 ++++++++ app/service/KnowledgeLibraryService.php | 8 ++++++++ plugin/piadmin/app/base/BaseDao.php | 2 +- 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/app/controller/EnterprisePortraitCategoryController.php b/app/controller/EnterprisePortraitCategoryController.php index 8384e28..ad08d6c 100644 --- a/app/controller/EnterprisePortraitCategoryController.php +++ b/app/controller/EnterprisePortraitCategoryController.php @@ -49,5 +49,8 @@ class EnterprisePortraitCategoryController return success($service->deleteData($id)); } - + public function pureIndex(EnterprisePortraitCategoryService $service) + { + return success($service->selectData()); + } } \ No newline at end of file diff --git a/app/controller/KnowledgeLibraryController.php b/app/controller/KnowledgeLibraryController.php index 95927da..0d7a087 100644 --- a/app/controller/KnowledgeLibraryController.php +++ b/app/controller/KnowledgeLibraryController.php @@ -33,4 +33,8 @@ class KnowledgeLibraryController return success($service->deleteData($id)); } + public function pureIndex(KnowledgeLibraryService $service) + { + return success($service->selectData()); + } } \ No newline at end of file diff --git a/app/route/route.php b/app/route/route.php index beb57ca..f4d42cf 100644 --- a/app/route/route.php +++ b/app/route/route.php @@ -1,5 +1,6 @@ setParams(['perm' => ['knowledgeIndex']]); //删除 Route::post('/delete', [KnowledgeLibraryController::class, 'delete'])->setParams(['perm' => ['knowledgeDelete']]); + //下拉数据 + Route::get('/pure/index', [KnowledgeLibraryController::class, 'pureIndex'])->setParams(['perm' => 'knowledgePureIndex']); }); //企业画像图库 @@ -64,6 +67,8 @@ Route::group('/service/v1', function () { Route::get('/read', [EnterprisePortraitCategoryController::class, 'read'])->setParams(['perm' => ['enterpriseCategoryRead']]); //删除 Route::post('/delete', [EnterprisePortraitCategoryController::class, 'delete'])->setParams(['perm' => ['enterpriseCategoryDelete']]); + //下拉数据 + Route::get('/pure/index', [EnterprisePortraitCategoryController::class, 'pureIndex'])->setParams(['perm' => 'enterpriseCategoryPureIndex']); }); //新增 diff --git a/app/service/EnterprisePortraitCategoryService.php b/app/service/EnterprisePortraitCategoryService.php index 1e8806d..b1208ca 100644 --- a/app/service/EnterprisePortraitCategoryService.php +++ b/app/service/EnterprisePortraitCategoryService.php @@ -117,4 +117,12 @@ class EnterprisePortraitCategoryService extends BaseService return ['id' => $id]; } + public function selectData() + { + $query = [ + 'delete_time' => 0 + ]; + $list = $this->dao->getList($query); + return $list; + } } \ No newline at end of file diff --git a/app/service/KnowledgeLibraryService.php b/app/service/KnowledgeLibraryService.php index 029a9e4..18a5e45 100644 --- a/app/service/KnowledgeLibraryService.php +++ b/app/service/KnowledgeLibraryService.php @@ -78,4 +78,12 @@ class KnowledgeLibraryService extends BaseService return ['id' => $id]; } + public function selectData() + { + $query = [ + 'delete_time' => 0 + ]; + $list = $this->dao->getList($query); + return $list; + } } \ No newline at end of file diff --git a/plugin/piadmin/app/base/BaseDao.php b/plugin/piadmin/app/base/BaseDao.php index 1a73bf7..386aa1b 100644 --- a/plugin/piadmin/app/base/BaseDao.php +++ b/plugin/piadmin/app/base/BaseDao.php @@ -693,7 +693,7 @@ abstract class BaseDao public function getList($where, $field='*', $page=0, $limit=0, $order='id desc',$with=[],$withCOunt=[]): array { - $query = $this->search($where)->with($with)->withCount($withCOunt)->field($field)->order($order); + $query = $this->search($where)->field($field)->with($with)->withCount($withCOunt)->order($order); if($page !== 0 && $limit !== 0){ $query = $query->page($page,$limit); }