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); }